[Geoserver-devel] Patch for ResourcePool.getGridCoverageReader

Justin, all

during my last weeks of arcsde gce stress testing, I found a potential concurrency penalty in ResourcePool.getGridCoverageReader. If hit with various concurrent requests at it may instantiate lots of readers to ultimately leave a single one cached.
The following patch applies the same trick than for ResourcePool.getDataStore, please let me know if it seems appropriate to you: <http://pastebin.com/m32ebb87b&gt;

It just double checks for the cached reader after acquiring the lock on the cache.

Cheers,
Gabriel

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Gabriel Roldan ha scritto:

Justin, all

during my last weeks of arcsde gce stress testing, I found a potential concurrency penalty in ResourcePool.getGridCoverageReader. If hit with various concurrent requests at it may instantiate lots of readers to ultimately leave a single one cached.
The following patch applies the same trick than for ResourcePool.getDataStore, please let me know if it seems appropriate to you: <http://pastebin.com/m32ebb87b&gt;

It just double checks for the cached reader after acquiring the lock on the cache.

The patch looks good to me.
Maybe remove those capital letters comments :wink:

(I noticed they are also in the original code, not sure why...)

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Thanks for the quick review Andrea,

I will commit with a related jira then just in case we want to roll it back later.

Cheers,
Gabriel

Andrea Aime wrote:

Gabriel Roldan ha scritto:

Justin, all

during my last weeks of arcsde gce stress testing, I found a potential concurrency penalty in ResourcePool.getGridCoverageReader. If hit with various concurrent requests at it may instantiate lots of readers to ultimately leave a single one cached.
The following patch applies the same trick than for ResourcePool.getDataStore, please let me know if it seems appropriate to you: <http://pastebin.com/m32ebb87b&gt;

It just double checks for the cached reader after acquiring the lock on the cache.

The patch looks good to me.
Maybe remove those capital letters comments :wink:

(I noticed they are also in the original code, not sure why...)

Cheers
Andrea

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.