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] Resend failed messages to failure transport using a delay from retry strategy#57672

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

Open
tunterreitmeier wants to merge3 commits intosymfony:6.4
base:6.4
Choose a base branch
Loading
fromtunterreitmeier:resend-failed-to-failure-transport

Conversation

tunterreitmeier
Copy link

@tunterreitmeiertunterreitmeier commentedJul 7, 2024
edited
Loading

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#53216#51815
LicenseMIT

This PR tries tofix#53216 and is a follow-up to#51815
It is somewhat of a stretch to call this a fix, as it changes behaviorand especially breaks the BC promise.
My sole argumentation for a fix would be that discarding instead of retrying messages is unexpected behavior, but this is subjective.
With changed behavior, I am very much open for comments and suggestions.

The changes are:

  • SendFailedMessageToFailureTransportListener does no longer discard messages if a message was already sent to a failure transport but uses a retry strategy to re-send it to the failure transport using an increasing delay
    • Messages will be retried indefinitely until successfully handled
  • SendFailedMessageToFailureTransportListener uses the lastReceivedStamp in order to not lose information about the original transport
    • It is assumed that theFailedMessageProcessingMiddleware is used
    • Otherwise e.g. a handler that is only registered for a specific transport (from_transport) would not be considered as a handler when retrieving retries from a failure transport
  • The defaultMutliplierRetryStrategy counts allRedeliveryStamps to determine the delay instead of the current retry loop
    • Reasons:
      • My argument would be that the delay should increase with every subsequent retrieval from the failure queue, regardless of the current retry in the retry strategy
      • A retry strategy with 0 retries would always use the default without increasing at all
  • TheAmqpSender does no longer default to where a message was previously received from as a routing key, when sending it to the failure transport
    • This did not really matter with the defaultfanout binding setup, but interferes with routing in the delay exchange

Limitations:

  • countingRedeliveryStamps is not reliable asSendFailedMessageForRetryListener limits (removes) them
    • this could be solved by including a total instead of just the current in theRedeliveryStamp

Changing the retry behaviorand the public constructor of the EventListener is definitely a breaking change. It's impossible to tell if a project relies on the fact that messages are discarded from the failure transport.
The constructor change is handled gracefully but it still requires some sort of default delay in order to not introduce the regression of an instant and infite retry loop.

Again, really happy for feedback!

@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 7.2 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

@tunterreitmeiertunterreitmeierforce-pushed theresend-failed-to-failure-transport branch fromc6a8bbf toee16513CompareJuly 7, 2024 05:35
*
* @group integration
*/
class FailureTransportIntegrationTest extends TestCase

Choose a reason for hiding this comment

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

Somewhat torn on this test as it requires so much setup.
I created it, as the "failure" logic broke with the change inAmqpSender and no auomated test caught it

Use retry strategy with an increasing delay to prevent handling failed messages too fast/often
…ailure transportThe failure transport uses a delay - the retry routing key from the previous stamp would interfere with publishing to the failure exchange/queue
@tunterreitmeiertunterreitmeierforce-pushed theresend-failed-to-failure-transport branch fromee16513 toea61fcbCompareJuly 8, 2024 17:45
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

3 participants
@tunterreitmeier@carsonbot@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp