Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 15, 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: #201814
Forward-Port-Of: #201401

@robodoo
Copy link
Contributor

robodoo commented Mar 15, 2025

Pull request status dashboard

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Mar 15, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 15, 2025

@Williambraecky cherrypicking of pull request #201401 failed.

stdout:

Auto-merging odoo/service/server.py
CONFLICT (content): Merge conflict in odoo/service/server.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

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

@C3POdoo C3POdoo added the RD research & development, internal work label Mar 15, 2025
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: a5461e6
@Williambraecky Williambraecky force-pushed the saas-18.2-16.0-pg_xact-error-fix-2-wbr-423260-fw branch from 1065cd4 to d5091b3 Compare March 15, 2025 17:17
@Williambraecky
Copy link
Contributor

@robodoo r+

@C3POdoo C3POdoo requested review from a team and Julien00859 and removed request for a team March 15, 2025 17:18
robodoo pushed a commit that referenced this pull request Mar 15, 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 #201967

X-original-commit: a5461e6
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
@robodoo robodoo closed this Mar 15, 2025
@fw-bot fw-bot deleted the saas-18.2-16.0-pg_xact-error-fix-2-wbr-423260-fw branch March 22, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR 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