Skip to content
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

[Messenger] Do not stack retry stamp #36810

Merged
merged 1 commit into from Aug 17, 2020
Merged

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented May 13, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets /
License MIT
Doc PR /

With the "RecoverableException" or a very high number of retry, the message is currently stacking a lot of stamp, which increase the size of the message sent to queue and (in my case) reach the "maximum size allowed" after 60 retries + php serializer

This PR removes previous stamps before adding the new Delay+RetryStamps.

@jderusse jderusse requested a review from sroze as a code owner May 13, 2020 17:03
@nicolas-grekas nicolas-grekas added this to the 5.1 milestone May 16, 2020
@nicolas-grekas nicolas-grekas changed the title Do not stack retry stamp [Messenger] Do not stack retry stamp May 16, 2020
@nicolas-grekas
Copy link
Member

Why not 4.4 since it's a bug fix proposal?

@jderusse jderusse changed the base branch from master to 4.4 May 16, 2020 09:08
@nicolas-grekas nicolas-grekas modified the milestones: 5.1, 4.4 May 16, 2020
@jderusse
Copy link
Member Author

indeed. fixed

Copy link
Member

@Tobion Tobion left a comment

Choose a reason for hiding this comment

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

Ref. #34082

Removing the RedeliveryStamps breaks the history feature, see

/** @var RedeliveryStamp[] $redeliveryStamps */
$redeliveryStamps = $envelope->all(RedeliveryStamp::class);
$io->writeln(' Message history:');
foreach ($redeliveryStamps as $redeliveryStamp) {
$io->writeln(sprintf(' * Message failed at <info>%s</info> and was redelivered', $redeliveryStamp->getRedeliveredAt()->format('Y-m-d H:i:s')));
}

We need to limit the stamps to the last x so it does still have history but does not grow endlessly. This has been started in #32904 alread.

@jderusse
Copy link
Member Author

Good catch @Tobion
Added a method to keep the only The first + last X stamps.

Tell me what you think

Copy link
Contributor

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

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

This would be really helpful!
Anything missing? Can we merge this?

@fabpot
Copy link
Member

fabpot commented Jul 15, 2020

@Tobion Can you have a look at this one?

@fabpot
Copy link
Member

fabpot commented Aug 17, 2020

Thank you @jderusse.

@fabpot fabpot merged commit df3ab76 into symfony:4.4 Aug 17, 2020
This was referenced Aug 31, 2020
@jderusse jderusse deleted the messenger-stamp branch October 15, 2020 10:01
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.

None yet

8 participants