-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Sporadic error with multi-threaded overview generation #10245
Comments
…es with GeoPackage in particular Fixes OSGeo#10245
…es with GeoPackage in particular Fixes OSGeo#10245
Of course there should be no errors of crashes, but I wonder how much sense there is in creating overviews in multiple threads. GeoPackage is an SQLite database and only one process at a time can write. But maybe it is slower to create the overviews than to save them into the database. Fortunately that should be rather easy to test. |
Multithreading in overview generation only affects the computation part (well for the GeoTIFF driver, this can also cause multi-threaded writes within the driver). This can help a bit depending on the resampling kernel. The issue here was that one of those computation worker threads accidentally queried the NBITS metadata item on the overview band, which on the first call can cause a SQLite request, wheras the I/O thread could potentially read or write GeoPackage blobs at the same time, hence a concurrent use of the same SQLite handle. Fixed per #10246 |
…es with GeoPackage in particular Fixes OSGeo#10245
…es with GeoPackage in particular Fixes OSGeo#10245
…es with GeoPackage in particular Fixes OSGeo#10245
What is the bug?
Running BuildOverviews on a GeoPackage dataset with config GDAL_NUM_THREADS=ALL_CPUS and bilinear resampling results in sporadic errors. The errors seem to happen around 50% of the time. Simpler resampling methods such as average and nearest does not appear to cause the error.
Steps to reproduce the issue
Running a script to repeat the BuildOverviews() function on the same source
MassiveGeopackage_output.zip
file multiple times. The files are stored on a spinning hard drive.
This results in the following output:
Versions and provenance
Windows 11
Python 3.12
GDAL 3.8.2 wheel from https://github.com/cgohlke/geospatial-wheels
Additional context
No response
The text was updated successfully, but these errors were encountered: