Skip to content

[Messenger] Add option to stop the worker after a message failed #35453

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

Merged
merged 1 commit into from
May 3, 2020
Merged

[Messenger] Add option to stop the worker after a message failed #35453

merged 1 commit into from
May 3, 2020

Conversation

micheh
Copy link
Contributor

@micheh micheh commented Jan 23, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #34414
License MIT
Doc PR

This pull request adds a new option to the messenger:consume command, to stop the worker after a specified amount of failed messages was handled by the worker.

@flaushi
Copy link

flaushi commented Mar 22, 2020

Hey, is there any chance this will be merged into 4.4 still? Current milestone seems to be 5.1.
Thanks in advance!

@ogizanagi
Copy link
Contributor

@flaushi : new features are never merged to already released branches.

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

I like this feature.

It is a good way to "just stop everything and start over" when something is wrong with the current process.

Could you rebase the PR please?

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

I like this - it seems like a sound option. We have had workers get into an "invalid" state for one reason or another (not commonly, but it has happened) and having the ability for a worker to exit if it's having too much trouble seems nice to me.

@fabpot
Copy link
Member

fabpot commented May 3, 2020

Thank you @micheh.

@Sereja3578
Copy link

I don't understand, how is it supposed to work? When doctrine throws an exception, EntityManager closes and we get a new message in the queue and then handler tries to process it again and fails with same error, then handler stops when reaches -failure-limit and then restores by supervisor. And then handler again gets same message that throws the same error.

@max-petrovich
Copy link

I don't understand, how is it supposed to work? When doctrine throws an exception, EntityManager closes and we get a new message in the queue and then handler tries to process it again and fails with same error, then handler stops when reaches -failure-limit and then restores by supervisor. And then handler again gets same message that throws the same error.

As i understand, after several retries your failed message will be sended to failure transport (or skipped if failure transport is not configured)

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.

[Messenger] Add option to stop the worker after a message failed
10 participants