This repository was archived by the owner on Jan 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Plpy interrupt #2
Merged
Merged
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
INT signals received when python code is not being executed affected code executed later.
The previous signal handler should always be restore upon module clean up. Note that a null pointer may be a valid handler specifier (SIG_DFL actually). We rely on _PG_fini calls being always paired with _PG_init. Note also that as of PostgreSQL 9.6 _PG_init isn't actually called ever (modules are never unloaded).
Returning 0 from the pending call function has the effect of not raising errors immediately. We must return -1 to make sure any errors are trapped in the current context.
Make sure Python exceptions occur in the context where the SIGINT occured
Contributor
Author
|
Two main improvements here:
Also minor fixes for correctness that affect none of CARTO operations to support SIG_DFL, SIG_IGN signal handler. |
|
Glad you find a way to improve this patch. Great work, looks great for me :))))) |
Remove unnecessary remnants from previous tests: * No need to keep track of plpython context nesting level * No need to pass arguments to the python pending call
Contributor
|
while trying to generate the package from the sources: I'll try to get it fixed. |
See CartoDB/postgres#5 and more specifically the commit b319cee
Contributor
|
It should be soon available for testing here: https://launchpad.net/~cartodb/+archive/ubuntu/postgresql-next |
Contributor
|
@azamorano or @jvillarf can you please take a look? |
Contributor
|
@jgoizueta one last check? |
Contributor
Author
|
👍 I've checked the effect of the final patch and it matches the intended code, which I've also updated in CartoDB/postgres#5 (it had some extraneous characters there as @ethervoid had noticed). Thanks for taking care of this! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Some fixes and enhancements for more reliable plpython execution interruption.