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] RespectisRetryable decision of the retry strategy for re-delivery#49063

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:5.4fromFlyingDR:respect-retryable-from-retry-strategy
May 12, 2023
Merged

[Messenger] RespectisRetryable decision of the retry strategy for re-delivery#49063

fabpot merged 1 commit intosymfony:5.4fromFlyingDR:respect-retryable-from-retry-strategy
May 12, 2023

Conversation

FlyingDR
Copy link
Contributor

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

Documentation for retry strategy for the Messenger component declares that message will not be retried to be re-delivered more than the value ofmax_retries configuration for the retry strategy.

However, after merging#36557actual implementation gives priority to the existence of theRecoverableExceptionInterface, effectively opening a way for a message to be re-delivered indefinitely.

Additionally, in the case of usingmultiplier with a value of more than 1 this unlimited re-delivery causes unlimited growth of thedelay value for theDelayStamp. Its type is defined asint, so on 32-bit platforms after some timedelay value may exceedPHP_INT_MAX which will lead to theTypeError.

The proposed change enforces respect for themax_retries setting value for the decision of re-delivery.

… deciding if failed message should be re-delivered
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

I think@deguif has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@FlyingDR
Copy link
ContributorAuthor

@nicolas-grekas Any chance for review? :)

@fabpot
Copy link
Member

Thank you@FlyingDR.

@fabpotfabpot merged commitf055c80 intosymfony:5.4May 12, 2023
@FlyingDRFlyingDR deleted the respect-retryable-from-retry-strategy branchMay 12, 2023 09:01
This was referencedMay 22, 2023
@rodnaph
Copy link
Contributor

@FlyingDR The current docs suggestRecoverableMessageHandlingException (viaRecoverableExceptionInterface) will be retried indefinitely, but from my reading this PR changes that behaviour so that it will only retry as per retry-strategy. Is that correct?

image

We were previously using this to retry messages which may possibly fail more times than the retry strategy.

Do the docs need updating, or has this introduced a regression? It seems this makes the above interface meaningless as all messages will be retried as per retry-strategy anyway.

@FlyingDR
Copy link
ContributorAuthor

@FlyingDR The current docs suggestRecoverableMessageHandlingException (viaRecoverableExceptionInterface) will be retried indefinitely, but from my reading this PR changes that behaviour so that it will only retry as per retry-strategy. Is that correct?

It is a good point,@rodnaph, thank you. It really looks like a contradiction.

From my point of view ignoring the limit which is explicitly defined in the configuration is not a good idea by itself, at least not in case if it is done silently. Also, as I wrote in the description of the pull request - there is a possibly unwanted side effect when using redelivery along withmultiplier configuration.

We were previously using this to retry messages which may possibly fail more times than the retry strategy.

You can still do it by creating your own service that implementsRetryStrategyInterface and tell Symfony to use it by using theretry_strategy.service configuration option. It may be hard to notice its existence from the documentation, but it isavailable.

Do the docs need updating, or has this introduced a regression? It seems this makes the above interface meaningless as all messages will be retried as per retry-strategy anyway.

Documentation has to be updated, you're right, thank you. I will provide a PR for it.

@rodnaph
Copy link
Contributor

@FlyingDR Thanks for the clarification and suggested workaround 👍

Also, as I wrote in the description of the pull request - there is a possibly unwanted side effect when using redelivery along with multiplier configuration.

This sounds like a separate issue that should be addressed in that retry strategy.

@nicolas-grekas As it stands I think this PR should be reverted as it causes a regression in existing functionality. If it's decided that this functionality is undesirable and should be removed then that can be done by deprecating and then removing in a future release. WDYT?

@fabpot
Copy link
Member

This PR has now been reverted.

rodnaph reacted with thumbs up emoji

fabpot added a commit that referenced this pull requestJun 21, 2023
… for re-delivery" (bendavies)This PR was merged into the 5.4 branch.Discussion----------Revert "Respect isRetryable decision of the retry strategy for re-delivery"| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | Reverts#49063| License       | MIT| Doc PR        |Revert "[Messenger] Respect `isRetryable` decision of the retry strategy when deciding if failed message should be re-delivered"This reverts#49063The linked PR rendered `RecoverableExceptionInterface` useless - i.e. it would not retry indefinately as stated in the docs.See the [discussion on the original PR](#49063 (comment))Commits-------dd328a2 Revert "[Messenger] Respect `isRetryable` decision of the retry strategy when deciding if failed message should be re-delivered"
@renovaterenovatebot mentioned this pull requestDec 5, 2023
1 task
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

6 participants
@FlyingDR@carsonbot@fabpot@rodnaph@nicolas-grekas@fwolfsjaeger

[8]ページ先頭

©2009-2025 Movatter.jp