Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] Don't lock tables or start transactions#40376

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@Nyholm
Copy link
Member

QA
Branch?5.2
Bug fix?yes
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

I was so sure my PR#40336 fixed the doctrine-messenger issue once and for all. But it had a very silent bug..

This has been tricky to debug and find because thePDO behaves differently in PHP 7.4 compared to PHP 8.

ScenarioCommandIs executed in transactionMethod that callsPostgreSqlConnection::getTriggerSql()
Amessenger:setup-transportsNosetup()
Bdoctrine:schema:createNogetExtraSetupSqlForTable()
Cdoctrine:migration:diffYes by default, but it can be configuredgetExtraSetupSqlForTable()

PR#40055 fixed scenario C on PHP 8, but that also broke scenario B on PHP 7.4 and PHP 8.
In PR#40336 I was wrong claiming:

We don't need COMMIT because the transaction will commit itself when we close the connection.

The result was the we removed all the errors messages from the 3 scenarios. But scenario B will produce some SQL that is actually never committed. IE it will silently fail.

I've been trying to figure out a good solution to how or when to start a transaction. I tried out@fbourigaultsuggestion but that would be the same fix as#40055.


We need a transaction because the SQL includes aLOCK TABLE, however, I cannot see a strict need for it. This PR removesLOCK TABLE and all transaction juggling. It all seams to work.

I would be happy to get thorough feedback on this PR so we can end the chapter of constantly adding bugs to this part of the component.

@dunglas, you addedLOCK TABLE in your initial version of this class in#35485, could you share some knowledge if this is a good or bad idea?

@dunglas
Copy link
Member

dunglas commentedMar 5, 2021
edited
Loading

IIRC it was to prevent data to be added to the table while the trigger is being created but I think that it's an edge case. (I'm not even sure if it can happen). +1 on my side for this patch.

Nyholm reacted with heart emoji

@fabpot
Copy link
Member

Thank you@Nyholm.

@fabpotfabpot merged commit9978ba8 intosymfony:5.2Mar 5, 2021
@Nyholm
Copy link
MemberAuthor

Thank you for merging. I’m sorry that I did not find this issue yesterday.

@NyholmNyholm deleted the messenger-postgress-transaction branchMarch 5, 2021 20:20
@fabpotfabpot mentioned this pull requestMar 10, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr approved these changes

@srozesrozeAwaiting requested review from sroze

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

5 participants

@Nyholm@dunglas@fabpot@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp