Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15388083
D21199.id50495.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
891 B
Referenced Files
None
Subscribers
None
D21199.id50495.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
@@ -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
Details
Attached
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)
Attached To
Mode
D21199: When recent PHP raises a "broken pipe" error in ExecFuture, treat it as a blocked stdin
Attached
Detach File
Event Timeline
Log In to Comment