Deadlock in ReferencingFactoryFinder

Description

I found this issue: https://osgeo-org.atlassian.net/browse/GEOT-4780
It's marked as Fixed, but today i came across the same problem, the deadlock in the ReferencingFactoryFinder.

This is the trace for all the stuck threads:

{{ java.lang.Thread.State: BLOCKED (on object monitor)
at org.geotools.referencing.ReferencingFactoryFinder.getFactory(ReferencingFactoryFinder.java:196)

  • waiting to lock <0x0000000780b12658> (a java.lang.Class for org.geotools.referencing.ReferencingFactoryFinder)
    at org.geotools.referencing.ReferencingFactoryFinder.getDatumFactory(ReferencingFactoryFinder.java:236)
    at org.geotools.coverage.grid.io.imageio.geotiff.GeoTiffMetadata2CRSAdapter.<init>(GeoTiffMetadata2CRSAdapter.java:173)
    at org.geotools.gce.geotiff.GeoTiffReader.getHRInfo(GeoTiffReader.java:304)
    at org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java:249)
    ...
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
    }}

Basically what i do is i read the tiff file, make some pixel modifications and write the tif to a new file. Reading si done simply by using: GeoTiffReader reader = new GeoTiffReader(file);

Then after some time (in my case using 15 threads, usually after 2000 processed tifs) the deadlock happens.

Environment

Windows 7, JDK 7 (x64), GT 14.3

Status

Assignee

Unassigned

Reporter

Blaž Repnik

Triage

None

Components

Affects versions

Priority

High
Configure