Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#1601 closed defect (fixed)

MgLayer constructor is not thread safe

Reported by: trevorwekel Owned by: trevorwekel
Priority: high Milestone: 2.2
Component: Web API Version: 2.2.0
Severity: critical Keywords:
Cc: External ID:

Description

Drop the attached aspx script in the mapviewernet folder and run it with a multi-user load. The MgLayer(resource id, resource service) constructor will fail and cease to execute on subsequent requests.

Attachments (2)

testMgLayer.aspx (2.5 KB) - added by trevorwekel 8 years ago.
Simple test script to reproduce defect
mglayerbase.patch (1.6 KB) - added by trevorwekel 8 years ago.
Low impact patch without mutex

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by trevorwekel

Attachment: testMgLayer.aspx added

Simple test script to reproduce defect

comment:1 Changed 8 years ago by trevorwekel

The following variable in http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Common/MdfParser/IOUtil.cpp?rev=29 is not thread safe. A workaround patch is attached. The more correct fix is to rewrite the tabcount logic.

int tabcount = 0;

Changed 8 years ago by trevorwekel

Attachment: mglayerbase.patch added

Low impact patch without mutex

comment:2 Changed 8 years ago by trevorwekel

Based on performance testing, I have replaced the SerializeToXML call with a read of the original bytes from the call to MgResourceService.GetResourceContent. This should also speed up the MgLayer constructor.

comment:3 Changed 7 years ago by trevorwekel

Owner: set to trevorwekel

Patch has been verified with 72+ hours of load testing. It may also fix the WMS errors reported on the mapguide-users list.

Patch submitted to branches/2.2 in r5567

comment:4 Changed 7 years ago by trevorwekel

Resolution: fixed
Status: newclosed

Submitted to trunk in r5595

comment:5 Changed 7 years ago by ChristineBao

The change was submitted to sandbox/adsk/2.2gp r5580 in another submission.

comment:6 Changed 7 years ago by ChristineBao

Submit to sandbox/adsk/2.3r in r5870.

Note: See TracTickets for help on using tickets.