Skip to content
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

[Messenger] Change the default notify timeout value for PostgreSQL #36990

Merged
merged 1 commit into from May 29, 2020

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented May 28, 2020

Q A
Branch? 5.1
Bug fix? yes-ish
New feature? no
Deprecations? no
Tickets n/a
License MIT
Doc PR n/a

The default value of 0 means that notify is kind of disable and that incurs many SQL requests. 10 minutes is kind of arbitrary but seems to be a good balance between waiting for a message (blocking) and trying again later in case of an issue.

@fabpot
Copy link
Member Author

fabpot commented May 28, 2020

@dunglas Does that make sense for you?

@dunglas
Copy link
Member

dunglas commented May 28, 2020

It shouldn't be the case because of

(microtime(true) * 1000 - $this->queueEmptiedAt < $this->configuration['check_delayed_interval'])
) {
return null;
}

The loop should consume some CPU to allow checking for delayed updates, but shouldn't sent useless SQL queries except when check_delayed_interval is reached.

Maybe that the default value of check_delayed_interval should be increased. But we have to find a tradeoff to support both features (delayed messages and notify). Maybe should we also make it bold in the docs that check_delayed_interval should be disabled if this feature isn't used.

By the way, we should maybe call usleep() here

to save some CPU.

@fabpot fabpot force-pushed the messenger-notify-timeout-default-value branch from b841eab to 6e5a761 Compare May 28, 2020 17:14
@fabpot fabpot force-pushed the messenger-notify-timeout-default-value branch from 6e5a761 to d9decf9 Compare May 29, 2020 03:17
@fabpot fabpot merged commit 2ff26b7 into symfony:5.1 May 29, 2020
@fabpot fabpot deleted the messenger-notify-timeout-default-value branch May 29, 2020 03:19
@fabpot fabpot mentioned this pull request May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants