Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented 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 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.

Forward-Port-Of: #201401

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.

X-original-commit: 6d34869
@robodoo
Copy link
Contributor

robodoo commented Mar 14, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 14, 2025

This PR targets 17.0 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 14, 2025
@C3POdoo C3POdoo added the RD research & development, internal work label Mar 14, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 14, 2025

@Williambraecky the next pull request (#201814) is in conflict. You can merge the chain up to here by saying

@robodoo r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@Williambraecky
Copy link
Contributor

@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 #201787

X-original-commit: 6d34869
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
@robodoo robodoo closed this Mar 14, 2025
@fw-bot fw-bot deleted the 17.0-16.0-pg_xact-error-fix-2-wbr-422282-fw branch March 21, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forwardport This PR was created by @fw-bot RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants