-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Behavior changed with messenger:consume and signals #52077
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
Labels
Comments
@hlecorche Hi, could you please check if #52080 fixes the issue. |
Hi @HypeMC , It works. Thank you very much for your work ! 🙂👍 |
fabpot
added a commit
that referenced
this issue
Oct 16, 2023
This PR was merged into the 6.3 branch. Discussion ---------- [Messenger] Fix graceful exit | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #52077 | License | MIT My previous PR #50787 accidentally broke the behavior of the `messenger:consume` command. It no longer waits for the handler to finish, instead it exists immediately. Commits ------- b270382 [Messenger] Fix graceful exit
hlecorche
added a commit
to hlecorche/messenger-supervisor-bundle
that referenced
this issue
Oct 17, 2023
hlecorche
added a commit
to hlecorche/messenger-supervisor-bundle
that referenced
this issue
Oct 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
6.3.5 and 6.3-dev
Description
Since version 6.3.5, there is a compatibility break with the
messenger:consume
command and signals.SIGINT
orSIGTERM
signals were sent, the worker stopped AFTER processing the current messageSIGINT
orSIGTERM
signals are sent, the worker stops immediately even if a message is being processed (hard stop)Here are some issues with this change :
supervisorctl stop xxx
command can stop the worker before the processing of the current message is completed (hard stop).Symfony\Component\Messenger\Event\WorkerMessageFailedEvent
event to catch an error. If an error is encountered, the listener stops the task group with Supervisor (with its API andSIGTERM
) and sends an email. Now when the event calls the Supervisor API to stop, all actions performed after its call are no longer performed:Link with #50787 ?
How to reproduce
Repository :
Commands :
php bin/console doctrine:database:create && php bin/console doctrine:schema:update --force
php bin/console app:create-message && php bin/console messenger:consume async -vvv
After (< 6.3.5) :
Now (6.3.5 and 6.3-dev) :
Possible Solution
No response
Additional Context
When I did my tests, pcntl was enabled (
echo \SIGINT;
returns2
)The text was updated successfully, but these errors were encountered: