-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[MESSENGER] Worker fail in loop on handling empty message #30649
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
Comments
I'm not sure if we should fix this or not in 4.2, but this is fixed in master (so, 4.3). In master, if a message fails to be decoded, we catch that and reject the message. If we want to fix this temporarily in 4.2, in But, as a mentioned, this is fixed in master :). |
Its looks broken even on master branch.
And this exception in not catchable in |
@SukachVitally You're right! We've covered the situation where the format of the message is invalid, but not the situation where the encoded data is empty. Those InvalidArgumentException should probably be MessageDecodingFailedException. |
… messages are rejected (weaverryan) This PR was merged into the 4.3-dev branch. Discussion ---------- Changing to MessageDecodingFailedException so that invalid messages are rejected | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #30649 | License | MIT | Doc PR | not needed for bug fix Bug fix if a message body is completely blank. I'm fixing this on master only, because in 4.2 and earlier, there is actually no system in place to fail serialization and cause the messages to be rejected. In 4.3, we just need to throw this exception. Cheers! Commits ------- 4be827d Changing to MessageDecodingFailedException so that invalid messages are rejected
Symfony version(s) affected: 4.2
Description
Messenger worker fail after handling message with empty body (or headers) and restart this process in loop. Other messages in queue become blocked.
No way to catch this exception in middleware or handler.
How to reproduce
php bin/console messenger:consume-messages some_transport
.Possible Solution
Symfony\Component\Messenger\Exception\InvalidArgumentException
to reject message.Symfony\Component\Messenger\Transport\AmqpExt\AmqpReceiver
Additional context
The text was updated successfully, but these errors were encountered: