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] Add support for RecoverableException#36557

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:masterfromjderusse:messenger-recoverable
May 4, 2020

Conversation

jderusse
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
TicketsN/A
LicenseMIT
Doc PRN/A

The messenger supports theUnrecoverableException preventing the messenger retry mechanism
when the Handler will never be able to process the Message.

This PR adds the opposite behavior to always retry the message.

UseCase:

  • High concurency Consumers use non-blocking lock
  • 503/429 errors from 3rd party API

@jderussejderusse requested a review fromsroze as acode ownerApril 23, 2020 23:25
@jderussejderusse changed the titleAdd support for RecoverableException[Messenger] Add support for RecoverableExceptionApr 23, 2020
@nicolas-grekasnicolas-grekas added this to thenext milestoneApr 24, 2020
@@ -87,6 +88,10 @@ public static function getSubscribedEvents()

private function shouldRetry(\Throwable $e, Envelope $envelope, RetryStrategyInterface $retryStrategy): bool
{
if ($e instanceof RecoverableExceptionInterface) {
return true;
}
Copy link
Member

Choose a reason for hiding this comment

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

What about theHandlerFailedException case where you need to check for the nested exceptions?

Also, a new test case for the listener would be ideal :)

@nicolas-grekas
Copy link
Member

(small rebase needed)

@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
@jderussejderusseforce-pushed themessenger-recoverable branch fromcc6a739 to1d385aaCompareMay 4, 2020 16:13
@jderusse
Copy link
MemberAuthor

rebased

@fabpotfabpotforce-pushed themessenger-recoverable branch from1d385aa toe7c3167CompareMay 4, 2020 16:55
@fabpot
Copy link
Member

Thank you@jderusse.

@fabpotfabpot merged commit0d4bba8 intosymfony:masterMay 4, 2020
@fabpotfabpot mentioned this pull requestMay 5, 2020
@jderussejderusse deleted the messenger-recoverable branchOctober 15, 2020 10:01
fabpot added a commit that referenced this pull requestMay 12, 2023
…rategy for re-delivery (FlyingDR)This PR was merged into the 5.4 branch.Discussion----------[Messenger] Respect `isRetryable` decision of the retry strategy for re-delivery| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       || License       | MIT| Doc PR        |[Documentation](https://symfony.com/doc/5.4/messenger.html#retries-failures) for retry strategy for the Messenger component declares that message will not be retried to be re-delivered more than the value of `max_retries` configuration for the retry strategy.However, after merging#36557 [actual implementation](https://github.com/symfony/symfony/blob/39cd93a9f7ea072b26853e87ceb1142d6dd019b0/src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.php#L126-L128) gives priority to the existence of the `RecoverableExceptionInterface`, effectively opening a way for a message to be re-delivered indefinitely.Additionally, in the case of using `multiplier` with a value of more than 1 this unlimited re-delivery causes unlimited growth of the `delay` value for the `DelayStamp`. Its type is defined as `int`, so on 32-bit platforms after some time `delay` value may exceed `PHP_INT_MAX` which will lead to the `TypeError`.The proposed change enforces respect for the `max_retries` setting value for the decision of re-delivery.Commits-------8fc3dcc [Messenger] Respect `isRetryable` decision of the retry strategy when deciding if failed message should be re-delivered
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fabpotfabpotfabpot approved these changes

@weaverryanweaverryanweaverryan approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@srozesrozeAwaiting requested review from sroze

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

6 participants
@jderusse@nicolas-grekas@fabpot@weaverryan@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp