Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14026696
D14920.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
D14920.diff
View Options
diff --git a/src/future/exec/ExecFuture.php b/src/future/exec/ExecFuture.php
--- a/src/future/exec/ExecFuture.php
+++ b/src/future/exec/ExecFuture.php
@@ -817,7 +817,18 @@
$max_stderr_read_bytes);
}
+ $is_done = false;
if (!$status['running']) {
+ // We may still have unread bytes on stdout or stderr, particularly if
+ // this future is being buffered and streamed. If we do, we don't want to
+ // consider the subprocess to have exited until we've read everything.
+ // See T9724 for context.
+ if (feof($stdout) && feof($stderr)) {
+ $is_done = true;
+ }
+ }
+
+ if ($is_done) {
if ($this->useWindowsFileStreams) {
fclose($stdout);
fclose($stderr);
diff --git a/src/future/exec/__tests__/ExecFutureTestCase.php b/src/future/exec/__tests__/ExecFutureTestCase.php
--- a/src/future/exec/__tests__/ExecFutureTestCase.php
+++ b/src/future/exec/__tests__/ExecFutureTestCase.php
@@ -150,6 +150,9 @@
// We expect to get the entire string back in the read.
$this->assertEqual($str_len_4, $read);
+
+ // Remove the limit so we can resolve the future.
+ $future->setReadBufferSize(null);
$future->resolve();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 1:57 AM (15 h, 14 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714784
Default Alt Text
D14920.diff (1 KB)
Attached To
Mode
D14920: Fix an issue where subprocesses could have data left on stdout/stderr
Attached
Detach File
Event Timeline
Log In to Comment