We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 738a73e commit 82b31c4Copy full SHA for 82b31c4
PhpAmqpLib/Connection/Heartbeat/SIGHeartbeatSender.php
@@ -56,6 +56,7 @@ public function unregister(): void
56
pcntl_signal($this->signal, SIG_IGN);
57
if ($this->childPid > 0) {
58
posix_kill($this->childPid, SIGKILL);
59
+ pcntl_waitpid($this->childPid, $status);
60
}
61
$this->childPid = null;
62
@@ -80,7 +81,11 @@ private function periodicAlarm(int $interval): void
80
81
$pid = pcntl_fork();
82
if(!$pid) {
83
while (true){
- sleep($interval);
84
+ $slept = sleep($interval);
85
+ if ($slept !== 0) {
86
+ // interupted by signal from parent, exit immediately
87
+ exit;
88
+ }
89
posix_kill($parent, $this->signal);
90
91
} else {
0 commit comments