Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15320693
D17553.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
D17553.diff
View Options
diff --git a/src/daemon/PhutilDaemonHandle.php b/src/daemon/PhutilDaemonHandle.php
--- a/src/daemon/PhutilDaemonHandle.php
+++ b/src/daemon/PhutilDaemonHandle.php
@@ -24,6 +24,7 @@
private $shouldRestart = true;
private $shouldShutdown;
private $hibernating = false;
+ private $shouldSendExitEvent = false;
private function __construct() {
// <empty>
@@ -90,6 +91,7 @@
public function didLaunch() {
$this->restartAt = time();
+ $this->shouldSendExitEvent = true;
$this->dispatchEvent(
self::EVENT_DID_LAUNCH,
@@ -184,7 +186,6 @@
if ($this->shouldShutdown) {
$this->restartAt = null;
- $this->dispatchEvent(self::EVENT_WILL_EXIT);
} else {
$this->scheduleRestart();
}
@@ -500,5 +501,13 @@
);
}
+ public function didExit() {
+ if ($this->shouldSendExitEvent) {
+ $this->dispatchEvent(self::EVENT_WILL_EXIT);
+ $this->shouldSendExitEvent = false;
+ }
+
+ return $this;
+ }
}
diff --git a/src/daemon/PhutilDaemonPool.php b/src/daemon/PhutilDaemonPool.php
--- a/src/daemon/PhutilDaemonPool.php
+++ b/src/daemon/PhutilDaemonPool.php
@@ -185,6 +185,8 @@
$daemon->update();
if ($daemon->isDone()) {
+ $daemon->didExit();
+
unset($this->daemons[$key]);
$this->logMessage(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 10:15 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7352503
Default Alt Text
D17553.diff (1 KB)
Attached To
Mode
D17553: Send EXIT events more consistently from daemons
Attached
Detach File
Event Timeline
Log In to Comment