Take 2: Patch for ticket 2596 (Constant crashes under high load/many concurrent requests)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Take 2: Patch for ticket 2596 (Constant crashes under high load/many concurrent requests)

Jackie Ng
Hi All,

Attached is a revised patch (2596_v4.patch) to address server stability issues reported on ticket 2596.

The main culprit is an improperly scoped Ptr<MgResourceLayerDefinitionCacheItem>, which combined with a refcount restriction in the cache itself (similar to the restriction for cached spatial context readers), could cause MdfModel::VectorLayerDefinition pointers to be prematurely deleted under high load.

The patch also ensures the scale setting code is only applied to VectorLayerDefinition pointers that didn't come from the 2nd level cache.

This patch also removes the use of CLocalizer in the geos library, which as reported by Andreas Morf, has been shown to cause additional instability due to its use of std::setlocale (which isn't thread safe). Since the mgserver already forces a "C" locale for numbers (LC_NUMERIC) on startup, the use of CLocalizer in geos would be redundant.

Please review. Thanks.

- Jackie