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] Fix graceful exit#52080

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:6.3fromHypeMC:fix-graceful-exit
Oct 16, 2023
Merged

Conversation

@HypeMC
Copy link
Member

QA
Branch?6.3
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#52077
LicenseMIT

My previous PR#50787 accidentally broke the behavior of themessenger:consume command. It no longer waits for the handler to finish, instead it exists immediately.

hlecorche and chalasr reacted with thumbs up emoji
$this->worker->stop();

return0;
returnfalse;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

There's no need to exit here, we just have to call$this->worker->stop() and the command will finish gracefully once the handler is done.

Comment on lines -201 to +213
$shouldHandle =$shouldForce ||'retry' ===$io->choice('Please select an action', ['retry','delete'],'retry');
$this->forceExit =true;
try {
$shouldHandle =$shouldForce ||'retry' ===$io->choice('Please select an action', ['retry','delete'],'retry');
}finally {
$this->forceExit =false;
}
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

With themessenger:failed:retry it's a little different, the$io->choice() method has an infinitive loop, so we need to exit if the command is waiting for an answer, otherwise we're stuck in the loop, which is the original issue that I tried to fix in#50787.

Comment on lines +162 to +164
if ($this->shouldStop) {
break;
}
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is required because the worker is instantiated in loops as well.


// avoid success message if nothing was processed
if (1 <=$count) {
if (1 <=$count && !$this->shouldStop) {
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

To avoid printing the message if the command has been terminated.

@fabpot
Copy link
Member

Thank you@HypeMC.

@fabpotfabpot merged commit8a1fba8 intosymfony:6.3Oct 16, 2023
@HypeMCHypeMC deleted the fix-graceful-exit branchOctober 16, 2023 23:14
@HypeMCHypeMC mentioned this pull requestOct 16, 2023
fabpot added a commit that referenced this pull requestOct 17, 2023
This PR was merged into the 6.3 branch.Discussion----------[Messenger] Simplify code| Q             | A| ------------- | ---| Branch?       | 6.3| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MITFollow up to#52080Commits-------49a452d [Messenger] Simplify code
fabpot added a commit that referenced this pull requestOct 20, 2023
This PR was merged into the 6.3 branch.Discussion----------[Messenger] Fix graceful exit with ids| Q             | A| ------------- | ---| Branch?       | 6.3| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MITOne last case I missed in#52080Commits-------1fc56bb [Messenger] Fix graceful exit with ids
@fabpotfabpot mentioned this pull requestOct 21, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.3

Development

Successfully merging this pull request may close these issues.

3 participants

@HypeMC@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp