-
Notifications
You must be signed in to change notification settings - Fork 74
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
BUG: Doorman manager child processing fix. #305
BUG: Doorman manager child processing fix. #305
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise its fine, though a couple of questions
You'll need to rebase/retarget this to 4
since it has new API
Also, would it be worth simply making this PR straight to asyncphp/doorman instead?
src/Services/ProcessManager.php
Outdated
|
||
public function __destruct() | ||
{ | ||
// Prevent background tasks from being killed when this script finishes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a valid reason why the default behaviour may be good? Is it worth making this behaviour a configurable value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default behaviour is generally considered a more safe option and I would still want to keep it as a default. The only reason why we can bypass this here is that this module has a very good system in place which keeps track of running jobs (job locking...).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so you're saying that it's no worth making this configurable because the queued jobs module does such a good job?
Should we do either of the following?
a) make this configurable?
b) add your rationale for why it's ok to bypass into the inline comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look at it in detail and I think it's worth making it configurable. There might be some cases where you want this to be disabled.
57d3abd
to
757741f
Compare
Rebased to |
@emteknetnz To answer your question:
I don't think this changeset belongs to the doorman module as the change by itself is probably a bit dangerous default. In the context of this module it's different as there are other mechanisms in place which makes this change reasonable (job locking, execution timeouts). |
Mojmir, looking good, just a couple of questions around the destruct function |
@emteknetnz Pushed up new changes (configurable child process termination + docs), please review. |
Doorman manager child processing fix
Problem
Using asynchronous queue runner has a flaw - when the manager process terminates, it also terminates all of its child processes. This is a mistake because there is a valid use case where manager process doesn't have any more work to do (no more jobs to start) but the child processes are still executing jobs.
Solution
Fix the shell command and prevent the manager process from killing of the child processes.
Notes
asyncphp/doorman
Feature 9 - Job manager process
Related issues
#306