Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix missing dispatch WorkerStoppedEvent after SIGINT or SIGTERM #52123

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

Closed
wants to merge 1 commit into from
Closed

Fix missing dispatch WorkerStoppedEvent after SIGINT or SIGTERM #52123

wants to merge 1 commit into from

Conversation

Chris53897
Copy link
Contributor

Q A
Branch? 6.3
Bug fix? yes?
New feature? no
Deprecations? no
License MIT

Related to #52077

In my point of view this Event should be dispatched here.
But maybe there are reasons for not doing this in the past.

I am not sure if bugfix or new feature.

@carsonbot carsonbot added this to the 6.3 milestone Oct 18, 2023
@Chris53897 Chris53897 changed the title fix(messenger): send WorkerStoppedEvent after SIGINT or SIGTERM [Messenger] Fix missing dispatch WorkerStoppedEvent after SIGINT or SIGTERM Oct 18, 2023
@@ -271,6 +272,8 @@ public function handleSignal(int $signal, int|false $previousExitCode = 0): int|

$this->worker->stop();

$this->eventDispatcher?->dispatch(new WorkerStoppedEvent($this->worker));
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't look necessary to me. The event should already be dispatched at the end of the Worker::run() method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Worker::run() is not called in the case of SIGINT or SIGTERM

Copy link
Member

Choose a reason for hiding this comment

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

Are you sure that's still the case after the fix from #52080?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i will check that

@OskarStark OskarStark changed the title [Messenger] Fix missing dispatch WorkerStoppedEvent after SIGINT or SIGTERM [Messenger] Fix missing dispatch WorkerStoppedEvent after SIGINT or SIGTERM Oct 20, 2023
@carsonbot carsonbot changed the title [Messenger] Fix missing dispatch WorkerStoppedEvent after SIGINT or SIGTERM Fix missing dispatch WorkerStoppedEvent after SIGINT or SIGTERM Oct 20, 2023
@OskarStark
Copy link
Contributor

Any news @Chris53897 ?

@Chris53897
Copy link
Contributor Author

Sorry for late response.
Look like the the other PR fixes this.
Last time i checked only 6.3.4 (as i thought it will have the same behaviour. like described in the issue). 6.3.4 does not throw the event.

I will close this PR.

@Chris53897 Chris53897 closed this Oct 20, 2023
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.

5 participants