mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 18:52:42 +01:00
(stable) Discard stdout/stderr from the aphlict subprocess when running in daemon (normal) mode
Summary: Fixes T11818. We don't discard output, so once we read more than 2GB of output we'll exceed the maximum size of a string in an internal buffer. Instead, configure the future so output is discarded. Test Plan: Added logging to `libphutil/`, saw internal buffer grow steadily before this change and stay constant at 0 after this change. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11818 Differential Revision: https://secure.phabricator.com/D16855
This commit is contained in:
parent
8a3d6071a0
commit
fc71a7e92d
1 changed files with 8 additions and 0 deletions
|
@ -416,6 +416,14 @@ abstract class PhabricatorAphlictManagementWorkflow
|
||||||
while (true) {
|
while (true) {
|
||||||
global $g_future;
|
global $g_future;
|
||||||
$g_future = new ExecFuture('exec %C', $command);
|
$g_future = new ExecFuture('exec %C', $command);
|
||||||
|
|
||||||
|
// Discard all output the subprocess produces: it writes to the log on
|
||||||
|
// disk, so we don't need to send the output anywhere and can just
|
||||||
|
// throw it away.
|
||||||
|
$g_future
|
||||||
|
->setStdoutSizeLimit(0)
|
||||||
|
->setStderrSizeLimit(0);
|
||||||
|
|
||||||
$g_future->resolve();
|
$g_future->resolve();
|
||||||
|
|
||||||
// If the server exited, wait a couple of seconds and restart it.
|
// If the server exited, wait a couple of seconds and restart it.
|
||||||
|
|
Loading…
Reference in a new issue