-
Notifications
You must be signed in to change notification settings - Fork 23
Protect against a 'soft' package configuration failure. #177
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If for some reason qgis_reconfigure() is interrupted, the cache elements remain NULL, but qgis_process can possibly still be accessed. An example was seen in #176. This commit adds some protection, in essence making qgis_run() able to access the backend, which will at least aid in further debugging.
If path is NULL, then typically also version will be NULL. Furthermore it is wise to update version anyway after path has been (re)set. So if path is NULL, both path and version are now queried and cached by qgis_run().
This is part of a series of small efforts to maintain some package functionality in a situation where package configuration did not succeed completely, but qgis_process can be accessed nevertheless.
…ting error * Avoiding to throw an error during configuration also avoids triggering qgis_unconfigure(), which otherwise resets the cache environment elements to NULL. As a result, half-configured states can emerge, but the problem of not being able to build & save the cache (which needs has_qgis()) is communicated to the user. Also the individual fails are reported. Moreover, the half-configured state still allows some functionality, and also the hardening in this commit ensures a graceful, non-interrupted execution of qgis_configure().
The assertion is well taken care of during pkg loading already. This assert_qgis() statement prevented qgis_algorithms() (which calls qgis_providers() in a message) to run in a semi-corrupted setup that could be recovered.
qgis_query_algorithms() is not run often, and printing qgis_process's stderr here may help in debugging if needed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If for some reason
qgis_reconfigure()
is interrupted, the cache elements are set back toNULL
byqgis_unconfigure()
, butqgis_process
can possibly still be accessed.An example was seen in #176.
This PR adds some protection in order to maintain some package functionality
in a situation where package configuration did not succeed completely, but
qgis_process
can be accessed nevertheless:qgis_run()
able to access the backend, will at least aid in further debugging.qgis_configure()
which would lead to resetting the package cache. As a result, half-configured states can emerge, but the problem of not being able to build & save the cache (which needshas_qgis()
) is communicated to the user. Also the individual fails are reported. Moreover, the half-configured state still allows some functionality.