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] Fix redis Connection::get() should be non blocking by default#31545

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:4.3fromchalasr:redis-non-blocking-reads
May 21, 2019

Conversation

@chalasr
Copy link
Member

@chalasrchalasr commentedMay 19, 2019
edited
Loading

QA
Branch?4.3
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRtodo

The\Redis::xreadgroup() method waits until a message arrives or the specified timeout is reached before returning, which means thatRedisExt\Connection::get() is blocking.
That's inconsistent with other transports which all returns immediately in case there is no message, for instance the AMQP transport uses\Amqp::get() instead of\Amqp::consume() for this reason.
It also short-circuits the worker's stop logic: both the--time-limit option of themessenger:consume command and themessenger:stop-workers don't work with the redis transport.
This returns early in case the message count is 0 and no blocking timeout has been configured.

@chalasrchalasrforce-pushed theredis-non-blocking-reads branch froma64ef8e to454a738CompareMay 19, 2019 16:26
@chalasr
Copy link
MemberAuthor

ping@alexander-schranz also :)

@chalasrchalasrforce-pushed theredis-non-blocking-reads branch 4 times, most recently from705b6f8 to81136e7CompareMay 19, 2019 17:47
Copy link
Contributor

@alexander-schranzalexander-schranz left a comment

Choose a reason for hiding this comment

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

xReadGroup should be non blocking aslong as we don't give a block time. Did I implement there something false?

And as written the xlen I think is the false way to get the correct count value as this does also include pending and received messages.

Copy link
Contributor

@alexander-schranzalexander-schranz left a comment
edited
Loading

Choose a reason for hiding this comment

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

As discussed on slack this seems currently the only way to avoid a blocking request to omit the blocking parameter ofxreadgroup function.

@chalasr thank you for fixing this 👍

chalasr reacted with thumbs up emoji
@chalasrchalasrforce-pushed theredis-non-blocking-reads branch fromf478351 to229502aCompareMay 21, 2019 02:47
@fabpot
Copy link
Member

Thank you@chalasr.

@fabpotfabpot merged commit229502a intosymfony:4.3May 21, 2019
fabpot added a commit that referenced this pull requestMay 21, 2019
…king by default (chalasr)This PR was merged into the 4.3 branch.Discussion----------[Messenger] Fix redis Connection::get() should be non blocking by default| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | todoThe `\Redis::xreadgroup()` method waits until a message arrives or the specified timeout is reached before returning, which means that `RedisExt\Connection::get()` is blocking.That's inconsistent with other transports which all returns immediately in case there is no message, for instance the AMQP transport uses `\Amqp::get()` instead of `\Amqp::consume()` for this reason.It also short-circuits the worker's stop logic: both the `--time-limit` option of the `messenger:consume` command and the `messenger:stop-workers` don't work with the redis transport.This returns early in case the message count is 0 and no blocking timeout has been configured.Commits-------229502a [Messenger] Make redis Connection::get() non blocking by default
@chalasrchalasr deleted the redis-non-blocking-reads branchMay 21, 2019 08:26
@fabpotfabpot mentioned this pull requestMay 22, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@rvanlaakrvanlaakrvanlaak left review comments

@alexander-schranzalexander-schranzalexander-schranz approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

5 participants

@chalasr@fabpot@alexander-schranz@rvanlaak@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp