Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread safety issue in WCS 1.1 and 2.0 #4369

Closed
Schpidi opened this issue Jul 3, 2012 · 0 comments
Closed

Thread safety issue in WCS 1.1 and 2.0 #4369

Schpidi opened this issue Jul 3, 2012 · 0 comments
Assignees
Milestone

Comments

@Schpidi
Copy link
Member

Schpidi commented Jul 3, 2012

The usage of VSI IO in WCS 1.1 and 2.0 is non-thread safe . As you can see with below script all files are written to "/vsimem/wcsout" which is never cleaned.

#!/usr/bin/python

import mapscript
from osgeo import gdal

map = mapscript.mapObj('msautotest/wxs/wcs_simple.map')
ows_req = mapscript.OWSRequest()

ows_req.setParameter('service', 'wcs')
ows_req.setParameter('version', '2.0.0')
ows_req.setParameter('request', 'getcoverage')
ows_req.setParameter('coverageid', 'grey')
ows_req.setParameter('format', 'image/tiff')

ows_req.type = mapscript.MS_GET_REQUEST

def dispatch(i):

    format = map.getOutputFormatByName("GEOTIFF_BYTE")
    format.setOption("FILENAME","%d.tif"%i)

    mapscript.msIO_installStdoutToBuffer()
    dispatch_status = map.OWSDispatch(ows_req)
    result = mapscript.msIO_getStdoutBufferBytes()
    mapscript.msIO_resetHandlers()

    print "Length: %d" % len(result)
    print gdal.ReadDir("/vsimem/wcsout")

for i in range(2):
    dispatch(i)
constantinius added a commit to EOX-A/mapserver that referenced this issue Jul 4, 2012
Fixing the deletion of outputfiles in the vsimem file system
for both WCS 1.1 and WCS 2.0.
@ghost ghost assigned Schpidi Aug 24, 2012
@Schpidi Schpidi closed this as completed Aug 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant