Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15331886
D21424.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D21424.diff
View Options
diff --git a/src/infrastructure/daemon/PhutilDaemonHandle.php b/src/infrastructure/daemon/PhutilDaemonHandle.php
--- a/src/infrastructure/daemon/PhutilDaemonHandle.php
+++ b/src/infrastructure/daemon/PhutilDaemonHandle.php
@@ -327,13 +327,14 @@
private function annihilateProcessGroup() {
$pid = $this->getPID();
-
- $pgid = posix_getpgid($pid);
- if ($pid && $pgid) {
- posix_kill(-$pgid, SIGTERM);
- sleep($this->getKillDelay());
- posix_kill(-$pgid, SIGKILL);
- $this->pid = null;
+ if ($pid) {
+ $pgid = posix_getpgid($pid);
+ if ($pgid) {
+ posix_kill(-$pgid, SIGTERM);
+ sleep($this->getKillDelay());
+ posix_kill(-$pgid, SIGKILL);
+ $this->pid = null;
+ }
}
}
@@ -440,7 +441,10 @@
// naturally be restarted after it exits, as though it had exited after an
// unhandled exception.
- posix_kill($this->getPID(), SIGINT);
+ $pid = $this->getPID();
+ if ($pid) {
+ posix_kill($pid, SIGINT);
+ }
}
public function didReceiveGracefulSignal($signo) {
@@ -461,7 +465,10 @@
$this->logMessage('DONE', $sigmsg, $signo);
- posix_kill($this->getPID(), SIGINT);
+ $pid = $this->getPID();
+ if ($pid) {
+ posix_kill($pid, SIGINT);
+ }
}
public function didReceiveTerminateSignal($signo) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 8 2025, 2:57 PM (6 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7381870
Default Alt Text
D21424.diff (1 KB)
Attached To
Mode
D21424: Manage PIDs more carefully in DaemonHandle
Attached
Detach File
Event Timeline
Log In to Comment