Closed zeevdr closed 2 years ago
can you submit a pull request for that ?
@jcphill would you be interested in implementing this ? The above proposal that relies on calling pool.terminate() will require some monkey patching of the MPI pool object to provide a terminate() method
Sure, although I'll probably refactor to use a with statement rather than try/finally/terminate/close/join.
@zeevdr I'd appreciate your comments on https://github.com/OSGeo/gdal/pull/5675
The pool opened in https://github.com/OSGeo/gdal/blob/95c9d336b2db0c5d240f191638c116c37fd8bb02/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py#L3299
Will not be closed if an exceptio occurs before https://github.com/OSGeo/gdal/blob/95c9d336b2db0c5d240f191638c116c37fd8bb02/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py#L3337
should add
try/finally
.Somthing like: