-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
ci testsuite: TestQgsOfflineEditing fails with gdal >= 3.4.2 #48012
Comments
@nyalldawson do you think this changed result |
@Pedro-Murteira wanna add labels testsuite + upstream? |
That should be @nirvn |
Done |
bisecting shows it is triggered by OSGeo/gdal@419b112 |
Checked it, concerning the implementation @m-kuhn mentioned with the QGIS/tests/src/core/testqgsofflineediting.cpp Line 214 in 20dfa3c
|
Fixes qgis#48012 Basically, for offline editing, we ask QgsOgrProvider to adopt the behaviour it had before qgis#47098, that is use SQLite3 journal_mode = WAL even in read-only mode. Sorry, this "fix" is horrible, but I couldn't get with something better after many hours of investigation. The root cause seems to be that QgsOfflineEditing creates layers using direct OGR API or sqlite3 API, and also uses QgsOgrProviderUtils which has a GDAL dataset reuse mechanism. And all that does not place nicely at all. Maybe the root root cause is that the OGR GPKG driver establishes the list of layers at its opening, and if creates a new one behind its back, which is prone to happen with the dataset caching metchanism, the GDALDataset::GetLayerByName() method doesn't see the newly created layer. With that in mind, I tried to add calls to QgsOgrProviderUtils::invalidateCachedDatasets() but to no avail. Also QgsOgrProviderUtils::invalidateCachedLastModifiedDate() which is used by QgsOgrProvider::createEmptyLayer(), but to no avail. So basically I don't understand why offline editing worked before with a GPKG backend. I'd say it is pure luck. Note: I also saw that qgsofflineediting.cpp at line 315 calls offlineLayer->dataProvider()->invalidateConnections() but that method is only implemented in the Spatialite provider. I tried to implement it in the OGR one, but to no avail too.
Fixes qgis#48012 Basically, for offline editing, we ask QgsOgrProvider to adopt the behaviour it had before qgis#47098, that is use SQLite3 journal_mode = WAL even in read-only mode. Sorry, this "fix" is horrible, but I couldn't get with something better after many hours of investigation. The root cause seems to be that QgsOfflineEditing creates layers using direct OGR API or sqlite3 API, and also uses QgsOgrProvider which has a GDAL dataset reuse mechanism. And all that does not place nicely at all. Maybe the root root cause is that the OGR GPKG driver establishes the list of layers at its opening, and if creates a new one behind its back, which is prone to happen with the dataset caching metchanism, the GDALDataset::GetLayerByName() method doesn't see the newly created layer. With that in mind, I tried to add calls to QgsOgrProviderUtils::invalidateCachedDatasets() but to no avail. Also QgsOgrProviderUtils::invalidateCachedLastModifiedDate() which is used by QgsOgrProvider::createEmptyLayer(), but to no avail. So basically I don't understand why offline editing worked before with a GPKG backend. I'd say it is pure luck. Note: I also saw that qgsofflineediting.cpp at line 315 calls offlineLayer->dataProvider()->invalidateConnections() but that method is only implemented in the Spatialite provider. I tried to implement it in the OGR one, but to no avail too.
Horrible fix queued in #48059 |
Basically, for offline editing, we ask QgsOgrProvider to adopt the behaviour it had before qgis#47098, that is use SQLite3 journal_mode = WAL even in read-only mode. Sorry, this "fix" is horrible, but I couldn't get with something better after many hours of investigation. The root cause seems to be that QgsOfflineEditing creates layers using direct OGR API or sqlite3 API, and also uses QgsOgrProvider which has a GDAL dataset reuse mechanism. And all that does not place nicely at all. Maybe the root root cause is that the OGR GPKG driver establishes the list of layers at its opening, and if creates a new one behind its back, which is prone to happen with the dataset caching metchanism, the GDALDataset::GetLayerByName() method doesn't see the newly created layer. With that in mind, I tried to add calls to QgsOgrProviderUtils::invalidateCachedDatasets() but to no avail. Also QgsOgrProviderUtils::invalidateCachedLastModifiedDate() which is used by QgsOgrProvider::createEmptyLayer(), but to no avail. So basically I don't understand why offline editing worked before with a GPKG backend. I'd say it is pure luck. Note: I also saw that qgsofflineediting.cpp at line 315 calls offlineLayer->dataProvider()->invalidateConnections() but that method is only implemented in the Spatialite provider. I tried to implement it in the OGR one, but to no avail too.
Fixes #48012 Basically, for offline editing, we ask QgsOgrProvider to adopt the behaviour it had before #47098, that is use SQLite3 journal_mode = WAL even in read-only mode. Sorry, this "fix" is horrible, but I couldn't get with something better after many hours of investigation. The root cause seems to be that QgsOfflineEditing creates layers using direct OGR API or sqlite3 API, and also uses QgsOgrProvider which has a GDAL dataset reuse mechanism. And all that does not place nicely at all. Maybe the root root cause is that the OGR GPKG driver establishes the list of layers at its opening, and if creates a new one behind its back, which is prone to happen with the dataset caching metchanism, the GDALDataset::GetLayerByName() method doesn't see the newly created layer. With that in mind, I tried to add calls to QgsOgrProviderUtils::invalidateCachedDatasets() but to no avail. Also QgsOgrProviderUtils::invalidateCachedLastModifiedDate() which is used by QgsOgrProvider::createEmptyLayer(), but to no avail. So basically I don't understand why offline editing worked before with a GPKG backend. I'd say it is pure luck. Note: I also saw that qgsofflineediting.cpp at line 315 calls offlineLayer->dataProvider()->invalidateConnections() but that method is only implemented in the Spatialite provider. I tried to implement it in the OGR one, but to no avail too.
Fixes #48012 Basically, for offline editing, we ask QgsOgrProvider to adopt the behaviour it had before #47098, that is use SQLite3 journal_mode = WAL even in read-only mode. Sorry, this "fix" is horrible, but I couldn't get with something better after many hours of investigation. The root cause seems to be that QgsOfflineEditing creates layers using direct OGR API or sqlite3 API, and also uses QgsOgrProvider which has a GDAL dataset reuse mechanism. And all that does not place nicely at all. Maybe the root root cause is that the OGR GPKG driver establishes the list of layers at its opening, and if creates a new one behind its back, which is prone to happen with the dataset caching metchanism, the GDALDataset::GetLayerByName() method doesn't see the newly created layer. With that in mind, I tried to add calls to QgsOgrProviderUtils::invalidateCachedDatasets() but to no avail. Also QgsOgrProviderUtils::invalidateCachedLastModifiedDate() which is used by QgsOgrProvider::createEmptyLayer(), but to no avail. So basically I don't understand why offline editing worked before with a GPKG backend. I'd say it is pure luck. Note: I also saw that qgsofflineediting.cpp at line 315 calls offlineLayer->dataProvider()->invalidateConnections() but that method is only implemented in the Spatialite provider. I tried to implement it in the OGR one, but to no avail too.
Fixes #48012 Basically, for offline editing, we ask QgsOgrProvider to adopt the behaviour it had before #47098, that is use SQLite3 journal_mode = WAL even in read-only mode. Sorry, this "fix" is horrible, but I couldn't get with something better after many hours of investigation. The root cause seems to be that QgsOfflineEditing creates layers using direct OGR API or sqlite3 API, and also uses QgsOgrProvider which has a GDAL dataset reuse mechanism. And all that does not place nicely at all. Maybe the root root cause is that the OGR GPKG driver establishes the list of layers at its opening, and if creates a new one behind its back, which is prone to happen with the dataset caching metchanism, the GDALDataset::GetLayerByName() method doesn't see the newly created layer. With that in mind, I tried to add calls to QgsOgrProviderUtils::invalidateCachedDatasets() but to no avail. Also QgsOgrProviderUtils::invalidateCachedLastModifiedDate() which is used by QgsOgrProvider::createEmptyLayer(), but to no avail. So basically I don't understand why offline editing worked before with a GPKG backend. I'd say it is pure luck. Note: I also saw that qgsofflineediting.cpp at line 315 calls offlineLayer->dataProvider()->invalidateConnections() but that method is only implemented in the Spatialite provider. I tried to implement it in the OGR one, but to no avail too.
Fixes #48012 Basically, for offline editing, we ask QgsOgrProvider to adopt the behaviour it had before #47098, that is use SQLite3 journal_mode = WAL even in read-only mode. Sorry, this "fix" is horrible, but I couldn't get with something better after many hours of investigation. The root cause seems to be that QgsOfflineEditing creates layers using direct OGR API or sqlite3 API, and also uses QgsOgrProvider which has a GDAL dataset reuse mechanism. And all that does not place nicely at all. Maybe the root root cause is that the OGR GPKG driver establishes the list of layers at its opening, and if creates a new one behind its back, which is prone to happen with the dataset caching metchanism, the GDALDataset::GetLayerByName() method doesn't see the newly created layer. With that in mind, I tried to add calls to QgsOgrProviderUtils::invalidateCachedDatasets() but to no avail. Also QgsOgrProviderUtils::invalidateCachedLastModifiedDate() which is used by QgsOgrProvider::createEmptyLayer(), but to no avail. So basically I don't understand why offline editing worked before with a GPKG backend. I'd say it is pure luck. Note: I also saw that qgsofflineediting.cpp at line 315 calls offlineLayer->dataProvider()->invalidateConnections() but that method is only implemented in the Spatialite provider. I tried to implement it in the OGR one, but to no avail too.
Fixes #48012 Basically, for offline editing, we ask QgsOgrProvider to adopt the behaviour it had before #47098, that is use SQLite3 journal_mode = WAL even in read-only mode. Sorry, this "fix" is horrible, but I couldn't get with something better after many hours of investigation. The root cause seems to be that QgsOfflineEditing creates layers using direct OGR API or sqlite3 API, and also uses QgsOgrProvider which has a GDAL dataset reuse mechanism. And all that does not place nicely at all. Maybe the root root cause is that the OGR GPKG driver establishes the list of layers at its opening, and if creates a new one behind its back, which is prone to happen with the dataset caching metchanism, the GDALDataset::GetLayerByName() method doesn't see the newly created layer. With that in mind, I tried to add calls to QgsOgrProviderUtils::invalidateCachedDatasets() but to no avail. Also QgsOgrProviderUtils::invalidateCachedLastModifiedDate() which is used by QgsOgrProvider::createEmptyLayer(), but to no avail. So basically I don't understand why offline editing worked before with a GPKG backend. I'd say it is pure luck. Note: I also saw that qgsofflineediting.cpp at line 315 calls offlineLayer->dataProvider()->invalidateConnections() but that method is only implemented in the Spatialite provider. I tried to implement it in the OGR one, but to no avail too.
What is the bug or the crash?
test TestQgsOfflineEditing fails with gdal 3.4.2 related to fe410ec
Steps to reproduce the issue
compile & test master with gdal 3.4.2 (i.e. on fedora 36 as on PR #47887)
details see https://cdash.orfeo-toolbox.org/testDetails.php?test=35806854&build=95038
Versions
master with gdal=3.4.2
Supported QGIS version
New profile
Additional context
QGIS/tests/src/core/testqgsofflineediting.cpp
Lines 296 to 299 in 20dfa3c
The text was updated successfully, but these errors were encountered: