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] On failure retry, make message appear received from original sender#31425

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

Conversation

@weaverryan
Copy link
Member

@weaverryanweaverryan commentedMay 8, 2019
edited by fabpot
Loading

QA
Branch?master (4.3)
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#31413
LicenseMIT
Doc PRsymfony/symfony-docs#11236

Fixes a bug when using the transport-based handler config from#30958. This also adds a pretty robust integration test that dispatches a complex message with transport-based handler config, failures, failure transport, etc - and verifies the correct behavior.

Cheers!

@weaverryanweaverryan added this to the4.3 milestoneMay 8, 2019
@weaverryanweaverryanforce-pushed themessenger-retry-from-same-transport branch from4e6848a todb47a21CompareMay 8, 2019 14:42
@weaverryanweaverryanforce-pushed themessenger-retry-from-same-transport branch 3 times, most recently from8ad8b4c toce9154fCompareMay 8, 2019 18:08
}else {
// get() and ask messages one-by-one
$count =$this->runWorker($this->getReceiver(),$io,$shouldForce);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why it is only collecting one message at a time a few lines aboveforeach ($receiver->all(1) as $envelope) {? Wouldn't it be better to batch more messages to avoid querying doctrine for each message?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hmm. We could... but I don't see a lot of benefit. This is the interactive mode, and we're asking the user if they want to retry one-by-one. In theory, something else could also be reading from the failure transport at the same time, so getting whatever the latest id is one-by-one seems sensible.


$envelope =$event->getEnvelope();

// avoid re-sending to the failed sender
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that it makes sense. Otherwise consuming the failure transport could be an endless loop of processing and failing and requeuing.
But I think it should be explicitly warned in the retry command that the message will be gone after retrying it even if it fails again.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yep, exactly. However, the failure transport acts like any normal transport. If the transport has retries configured (by default it does, and the default is 3 tries), the message will be retried 3 times on the failure transport before being discarded. In this PR, I even added some extra info on the retry command that says that this message has already been tried 1/2/3... times on the failure transport previously.

@weaverryanweaverryanforce-pushed themessenger-retry-from-same-transport branch fromce9154f toecff07bCompareMay 9, 2019 01:09
@weaverryan
Copy link
MemberAuthor

This should be ready - tests passing - ready for review!

@nicolas-grekasnicolas-grekas changed the base branch frommaster to4.3May 9, 2019 14:00
@weaverryanweaverryanforce-pushed themessenger-retry-from-same-transport branch 4 times, most recently from0927cf0 to62f0bb6CompareMay 10, 2019 15:19
@weaverryan
Copy link
MemberAuthor

Ready to go again. This is mostly a small fix + some refactoring based on@Tobion's recommendations. The vast majority of the added lines are in a robust new integration test.

@fabpotfabpotforce-pushed themessenger-retry-from-same-transport branch from62f0bb6 to80b5df2CompareMay 11, 2019 06:54
@fabpot
Copy link
Member

Thank you@weaverryan.

@fabpotfabpot merged commit80b5df2 intosymfony:4.3May 11, 2019
fabpot added a commit that referenced this pull requestMay 11, 2019
… from original sender (weaverryan)This PR was squashed before being merged into the 4.3 branch (closes#31425).Discussion----------[Messenger] On failure retry, make message appear received from original sender| Q             | A| ------------- | ---| Branch?       | master (4.3)| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#31413| License       | MIT| Doc PR        |symfony/symfony-docs#11236Fixes a bug when using the transport-based handler config from#30958. This also adds a pretty robust integration test that dispatches a complex message with transport-based handler config, failures, failure transport, etc - and verifies the correct behavior.Cheers!Commits-------80b5df2 [Messenger] On failure retry, make message appear received from original sender
@weaverryanweaverryan deleted the messenger-retry-from-same-transport branchMay 14, 2019 10:50
@fabpotfabpot mentioned this pull requestMay 22, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

4 participants

@weaverryan@fabpot@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp