MapServer / MapServer-import

3 stars 2 forks source link

GDAL Raster files (dataset) are only closed in msCleanup #2275

Closed mapserver-bot closed 12 years ago

mapserver-bot commented 12 years ago

Reporter: aboudreault Date: 2011/12/07 - 19:43 The gdal dataset are never closed until msCleanup is called. All files remain open. We can easily checked this using lsof utility. We noticed the issue using python mapscript. We have a twisted web application using python mapscript and we can see that datasets are only closed if we kill the process. I would expect layer.close() to close the dataset as well... but it doesn't. The module probably only call msCleanup on exit.

I would say that FastCGI have the same problem... but I'm not sure yet.. have to test this.

mapserver-bot commented 12 years ago

Author: warmerdam Date: 2011/12/08 - 07:03 Alan, this is "working as intended". The default value for CLOSE_CONNECTION for singleton rasters (as opposed to tileindexed layers) is DEFER. You can explicitly add something like:

  PROCESSING "CLOSE_CONNECTION=ALWAYS" 

to ensure that rasters are not kept open by default. This is a moderately dangerous attempt at optimizing things that can come back to haunt.

Feel free to reopen the ticket if you feel it is really a bug or would like to see this better documented.