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

Always attempt to listen for notifications#47209

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
fabpot merged 1 commit intosymfony:5.4fromgoetas:pg-listen-close-connect
Aug 9, 2022

Conversation

goetas
Copy link
Contributor

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets#45056
LicenseMIT

as discussed in#45056 (comment), when a middleware closes the connection, the messenger consumer will not receive notifications when a new record is inserted.

Since is safe to callLISTEN multiple times, we can avoid having to keep tack if we did call or not the listen command, we call it always so we are always sure to get notifications with new messages are added.

@goetas
Copy link
ContributorAuthor

I've also added a test but i'm not sure it is worth the effort

@goetasgoetasforce-pushed thepg-listen-close-connect branch fromd2dd112 to5700919CompareAugust 6, 2022 06:47
@fabpotfabpot requested a review fromdunglasAugust 6, 2022 08:19
@dunglas
Copy link
Member

If we're sure that it's safe to callLISTEN multiple times (I didn't find any information about that in the manual), then +1 on my side!

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It is mentioned in the LISTEN docs that calling it when psql is already listening, does nothing. So, it looks like it "safe".

dunglas reacted with thumbs up emoji
@fabpot
Copy link
Member

@goetas Can you have a look at the tests,https://github.com/symfony/symfony/runs/7711529784?check_suite_focus=true might be related to this change.

Comment on lines 53 to 57
public function reset()
{
parent::reset();
$this->unlisten();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

don't we want to keep this? we still want to unlisten on reset, don't we?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

i have reverted a portion of this. I have also verified that callingUNLISTEN multiple times makes no harm

dunglas reacted with heart emoji
Copy link
Contributor

@bendaviesbendavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

thanks for taking this on !

@goetasgoetasforce-pushed thepg-listen-close-connect branch 2 times, most recently fromeaa0b31 tob462665CompareAugust 7, 2022 19:42
};

// dbal 2.x
if (interface_exists(Result::class)) {
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I had to do this weird thing to test against dbal 2.x and dbal 3.x. I'm not proud of it but i do not have a better idea

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You could maybe duplicate the test to remove the if (and skip if not using the good version). But IMHO that's good enough as-is.

@goetas
Copy link
ContributorAuthor

Can you have a look at the tests,https://github.com/symfony/symfony/runs/7711529784?check_suite_focus=true might be related to this change.

I have fixed the test, it was because i had locally dbal 3.x instlled while on CI 2.x is runing.https://github.com/symfony/symfony/pull/47209/files#r939714144 does a different mocking by trying to detect which dbal is running

@fabpotfabpotforce-pushed thepg-listen-close-connect branch fromb462665 to72ac5bfCompareAugust 9, 2022 12:54
@fabpot
Copy link
Member

Thank you@goetas.

@fabpotfabpot merged commitd0199b4 intosymfony:5.4Aug 9, 2022
This was referencedAug 26, 2022
@fabpotfabpot mentioned this pull requestSep 30, 2022
d-ph pushed a commit to d-ph/symfony that referenced this pull requestDec 9, 2022
…es with custom consumption priorities. Replaysymfony#47209 on top of this code change.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@bendaviesbendaviesbendavies left review comments

@fabpotfabpotfabpot approved these changes

@dunglasdunglasdunglas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

5 participants
@goetas@dunglas@fabpot@bendavies@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp