Opened 13 years ago

Closed 13 years ago

Last modified 13 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 13 years ago.
Simple test script to reproduce defect
mglayerbase.patch (1.6 KB ) - added by trevorwekel 13 years ago.
Low impact patch without mutex

Download all attachments as: .zip

Change History (8)

by trevorwekel, 13 years ago

Attachment: testMgLayer.aspx added

Simple test script to reproduce defect

comment:1 by trevorwekel, 13 years ago

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;

by trevorwekel, 13 years ago

Attachment: mglayerbase.patch added

Low impact patch without mutex

comment:2 by trevorwekel, 13 years ago

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 by trevorwekel, 13 years ago

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 by trevorwekel, 13 years ago

Resolution: fixed
Status: newclosed

Submitted to trunk in r5595

comment:5 by ChristineBao, 13 years ago

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

comment:6 by ChristineBao, 13 years ago

Submit to sandbox/adsk/2.3r in r5870.

Note: See TracTickets for help on using tickets.