Page MenuHomePhabricator

D21424.id50981.diff
No OneTemporary

D21424.id50981.diff

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

Mime Type
text/plain
Expires
Mar 9 2025, 11:16 AM (6 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7381870
Default Alt Text
D21424.id50981.diff (1 KB)

Event Timeline