[mapserver-dev] Mapserver thread safety

Michel.Dastous at bentley.com Michel.Dastous at bentley.com
Fri Aug 23 04:55:56 PDT 2013


Umberto,

Yep threading issue with Oracle seems to be fixed now, thanks for the quick fix! However, looking at mapows.c:2429 from beta2 sources shows that static variable epsgCode was not removed.

msOWSGetEPSGProj() seems to be called very often in WMS/WFS workflows...so I think it's important issue in a threaded environment.


-          Michel

From: Umberto Nicoletti [mailto:umberto.nicoletti at gmail.com]
Sent: Thursday, August 22, 2013 3:42 PM
To: Michel Dastous
Cc: MapServer Dev Mailing List
Subject: Re: [mapserver-dev] Mapserver thread safety

We managed to push a fix in time for 6.4.0, which we will improve in later release.
If you want, you could test the recently released betas:

http://mapserver.org/download.html#development-releases

BR,
Umberto


On Thu, Aug 22, 2013 at 9:13 PM, <Michel.Dastous at bentley.com<mailto:Michel.Dastous at bentley.com>> wrote:
What's the status about this?  I guess a fix for 6.4.0 release is too late?

Thanks

-----Original Message-----
From: thomas bonfort [mailto:thomas.bonfort at gmail.com<mailto:thomas.bonfort at gmail.com>]
Sent: Tuesday, August 13, 2013 12:21 PM
To: Michel Dastous
Cc: Umberto Nicoletti; MapServer Dev Mailing List
Subject: Re: [mapserver-dev] Mapserver thread safety
Nice catch!
Returning a reference to epsgCode in that function is, to my knowledge, to the best undefined behavior, clearly not thread safe, and should be fixed.

--
thomas

On 13 August 2013 16:31,  <Michel.Dastous at bentley.com<mailto:Michel.Dastous at bentley.com>> wrote:
> About WFS/WMS thread safety, looking at mapows.c I found a single
> static variable (epsgCode) used in msOWSGetEPSGProj().
>
>
>
> Instead of returning a static pointer, the method could easily take a
> buffer
> + buffer size as parameters... Not a big deal except that 62 calls to
> + that
> function will have to be modified.
>
>
>
> Is this the only thing that make WFS/WFS server non thread safe?
>
>
>
> Thanks !
>
>
>
>
>
> From: Michel Dastous
> Sent: Tuesday, August 13, 2013 9:45 AM
> To: 'Umberto Nicoletti'
>
>
> Cc: MapServer Dev Mailing List
> Subject: RE: [mapserver-dev] Mapserver thread safety
>
>
>
> Thank you very much! I will test it as soon as possible.
>
>
>
> From the page you sent me I realized that WMS/WFS server is not thread safe
> ("WMS/WFS server: static data used for state of dispatcher").   Is there any
> plan to fix this ? I could not find any ticket about this
>
>
>
> Thanks.
>
>
>
> From: Umberto Nicoletti [mailto:umberto.nicoletti at gmail.com<mailto:umberto.nicoletti at gmail.com>]
> Sent: Tuesday, August 13, 2013 8:49 AM
> To: Michel Dastous
> Cc: MapServer Dev Mailing List
> Subject: Re: [mapserver-dev] Mapserver thread safety
>
>
>
> FYI, I've opened this pull request which should fix the Oracle spatial
> issue you are seeing:
>
> https://github.com/mapserver/mapserver/pull/4729
>
> Let me know if it works for you.
>
>
>
> BR,
>
> Umberto
>
> On Tue, Aug 13, 2013 at 8:23 AM, Umberto Nicoletti
> <umberto.nicoletti at gmail.com<mailto:umberto.nicoletti at gmail.com>> wrote:
>
> Michel,
>
> this page attempts to keep track of which Mapserver components are
> thread
> safe:
>
>
>
> http://mapserver.org/faq.html#is-mapserver-thread-safe
>
>
>
> it must not be completely up to date as, as you found out, Oracle is
> listed as safe, while it's not.
>
> As for fixing it, it should be relatively easy as those two variables
> can be made local to the functions using them.
>
>
>
> Please open an issue and I will look into it asap.
>
>
>
> Umberto
>
>
>
>
>
> On Mon, Aug 12, 2013 at 9:44 PM, <Michel.Dastous at bentley.com<mailto:Michel.Dastous at bentley.com>> wrote:
>
> Hi all,
>
>
>
> I've been testing mapserver and its c# mapscript API for a while now,
> and I have noticed that making simultaneous Draw request on multiple
> maps containing Oracle layer will end up in memory corruption.  No
> surprise here since maporaclespatial.c uses static variables
> (ordinates_tdo and ordinates).
>
>
>
> My question is: Does anyone have already evaluated how much work it
> would require to make it thread safe (i.e remove those static
> variables from the
> code) ?
>
>
>
> Furthermore, I have also tested the MSSQL plugin which is stable under
> same conditions, unfortunately it doesn't seem to scale very well my 4
> core machines with maximum CPU usage of 15%.
>
>
>
> I don't think the problem come from mapserver' s rendering engine...
> when drawing a map with inlined data, I could easily reach a 90% usage.
>
>
>
> So any suggestions/information would be welcome.
>
>
>
> Thanks.
>
>
>
>
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org<mailto:mapserver-dev at lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
>
>
>
>
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org<mailto:mapserver-dev at lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>

_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org<mailto:mapserver-dev at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20130823/17881246/attachment-0001.html>


More information about the mapserver-dev mailing list