Shapefile locking unit test failure in ImagePyramidReaderTest for some 
configurations
-------------------------------------------------------------------------------------

                 Key: GEOT-2258
                 URL: http://jira.codehaus.org/browse/GEOT-2258
             Project: GeoTools
          Issue Type: Bug
          Components: data shapefile
    Affects Versions: 2.6-M0
         Environment: Debian Etch i386, jdk1.5.0_16
            Reporter: Ben Caradoc-Davies
            Assignee: Jesse Eichar
            Priority: Minor


On Debian Etch i386, jdk1.5.0_16, geotools trunk does not build, failing a unit 
test with some shapefile locking problem (see below). This is repeatable.

Workaround: upgrade to jdk1.5.0_17.

Adding a few string concatenations with no side effects in ShpFiles.java 
unlockRead (building debugging information) fixed the problem (Heisenbug!), so 
this looks like some sort of nasty threading issue. Slight configuration or 
code changes probably change the timing. There is no synchronisation of access 
to the map of lockers in ShpFiles.java. But why should this matter (mvn should 
be running this single-threaded)? Perplexing.

The error:

java.lang.IllegalArgumentException:
                        Expected requestor Shapefile datastore for
                        
:file:/home/buildbot/GeoServerTrunkSlave/build/geotools-trunk/modules/plugin/imagepyramid/target/test-classes/org/geotools/gce/imagepyramid/test-data/0/pyramid.shp
                        to have locked the url but it does not hold the lock 
for the URL
                        at
                        
org.geotools.data.shapefile.ShpFiles.unlockRead(ShpFiles.java:443)
                        at
                        
org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.needsGeneration(IndexedShapefileDataStore.java:572)
                        at
                        
org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.indexUseable(IndexedShapefileDataStore.java:517)
                        at
                        
org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.createFeatureReader(IndexedShapefileDataStore.java:354)
                        at
                        
org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.getFeatureReader(IndexedShapefileDataStore.java:342)
                        at
                        
org.geotools.data.AbstractDataStore.getFeatureReader(AbstractDataStore.java:385)
                        at
                        
org.geotools.data.DefaultFeatureResults.reader(DefaultFeatureResults.java:210)
                        at
                        
org.geotools.data.store.DataFeatureCollection.openIterator(DataFeatureCollection.java:227)
                        at
                        
org.geotools.data.store.DataFeatureCollection.iterator(DataFeatureCollection.java:197)
                        at
                        
org.geotools.data.store.DataFeatureCollection.features(DataFeatureCollection.java:186)
                        at 
org.geotools.gce.imagemosaic.MemorySpatialIndex.<init>(MemorySpatialIndex.java:74)
        at 
org.geotools.gce.imagemosaic.ImageMosaicReader.createIndex(ImageMosaicReader.java:1368)
        at 
org.geotools.gce.imagemosaic.ImageMosaicReader.<init>(ImageMosaicReader.java:358)
        at 
org.geotools.gce.imagemosaic.ImageMosaicReader.<init>(ImageMosaicReader.java:469)
        at 
org.geotools.gce.imagepyramid.ImagePyramidReader.loadRequestedTiles(ImagePyramidReader.java:535)
        at 
org.geotools.gce.imagepyramid.ImagePyramidReader.loadTiles(ImagePyramidReader.java:475)
        at 
org.geotools.gce.imagepyramid.ImagePyramidReader.read(ImagePyramidReader.java:403)
        at 
org.geotools.gce.imagepyramid.ImagePyramidReaderTest.testDefaultParameterValueString(ImagePyramidReaderTest.java:191)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at 
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
        at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
        at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to