Page MenuHomePhabricator

D18139.diff
No OneTemporary

D18139.diff

diff --git a/src/daemon/PhutilDaemonOverseer.php b/src/daemon/PhutilDaemonOverseer.php
--- a/src/daemon/PhutilDaemonOverseer.php
+++ b/src/daemon/PhutilDaemonOverseer.php
@@ -336,7 +336,21 @@
if ($pidfile !== $this->lastPidfile) {
$this->lastPidfile = $pidfile;
$pidfile_path = $this->piddir.'/daemon.'.getmypid();
- Filesystem::writeFile($pidfile_path, phutil_json_encode($pidfile));
+ try {
+ Filesystem::writeFile(
+ $pidfile_path,
+ phutil_json_encode($pidfile));
+ } catch (Exception $ex) {
+ // This write can fail if the disk is full. We already tested the
+ // directory for writability on startup, so just ignore this and
+ // move on rather than crashing. If the disk is full this error may
+ // not make it to a log file, but at least we tried.
+ $this->logMessage(
+ 'PIDF',
+ pht(
+ 'Unable to update PID file: %s.',
+ $ex->getMessage()));
+ }
}
}
@@ -377,6 +391,7 @@
switch ($type) {
case 'OVER':
case 'SGNL':
+ case 'PIDF':
$always_log = true;
break;
}

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 31, 3:36 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7720792
Default Alt Text
D18139.diff (1 KB)

Event Timeline