Page MenuHomePhabricator

D21199.id50495.diff
No OneTemporary

D21199.id50495.diff

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
@@ -713,7 +713,17 @@
while (isset($this->stdin) && $this->stdin->getByteLength()) {
$write_segment = $this->stdin->getAnyPrefix();
- $bytes = fwrite($stdin, $write_segment);
+ try {
+ $bytes = fwrite($stdin, $write_segment);
+ } catch (RuntimeException $ex) {
+ // If the subprocess has exited, we may get a broken pipe error here
+ // in recent versions of PHP. There does not seem to be any way to
+ // get the actual error code other than reading the exception string.
+
+ // For now, treat this as if writes are blocked.
+ break;
+ }
+
if ($bytes === false) {
throw new Exception(pht('Unable to write to stdin!'));
} else if ($bytes) {

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 3:17 AM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7383071
Default Alt Text
D21199.id50495.diff (891 B)

Event Timeline