-
Notifications
You must be signed in to change notification settings - Fork 30.1k
[FIX] odoo: improve pg_xact error mitigation #201401
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
Closed
Closed
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
|
This would work, but I think the cleaner solution is to close the underlying connection |
14d9036 to
2b72c07
Compare
kmagusiak
reviewed
Mar 13, 2025
kmagusiak
approved these changes
Mar 13, 2025
2b72c07 to
967186d
Compare
Initial PR: odoo#194141 It seems the fix above was not enough as it was assumed that connection (or backend in pg terms) were NOT being reused when initiated through `sql_db.connect`. For proper cleanup we need to reach [this part of the code](https://github.com/postgres/postgres/blob/REL_16_STABLE/src/backend/commands/async.c#L1260-L1298) which can be done in 3 ways: - calling UNLISTEN * and committing - closing the connection - aborting the transaction (before committing the listen) `UNLISTEN *` is a good candidate for this, but closing the connection seems to be the safer option.
967186d to
c27fc5c
Compare
kmagusiak
approved these changes
Mar 14, 2025
|
@kmagusiak Thanks for reviewing @robodoo r+ |
robodoo
pushed a commit
that referenced
this pull request
Mar 14, 2025
Initial PR: #194141 It seems the fix above was not enough as it was assumed that connection (or backend in pg terms) were NOT being reused when initiated through `sql_db.connect`. For proper cleanup we need to reach [this part of the code](https://github.com/postgres/postgres/blob/REL_16_STABLE/src/backend/commands/async.c#L1260-L1298) which can be done in 3 ways: - calling UNLISTEN * and committing - closing the connection - aborting the transaction (before committing the listen) `UNLISTEN *` is a good candidate for this, but closing the connection seems to be the safer option. closes #201401 Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This was referenced Mar 14, 2025
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.

Initial PR: #194141
It seems the fix above was not enough as it was assumed that connection (or backend in pg terms) were NOT being reused when initiated through
sql_db.connect.For proper cleanup we need to reach this part of the code which can be done in 3 ways:
UNLISTEN *is a good candidate for this, but closing the connection seems to be the safer option.