Page MenuHomePhabricator

When recent PHP raises a "broken pipe" error in ExecFuture, treat it as a blocked stdin
ClosedPublic

Authored by epriestley on May 1 2020, 2:10 PM.
Tags
None
Referenced Files
F19102058: D21199.diff
Fri, Dec 5, 5:27 AM
F19083318: D21199.id50495.diff
Tue, Dec 2, 12:33 PM
F18985474: D21199.id50483.diff
Nov 17 2025, 1:03 PM
F18856260: D21199.id.diff
Nov 1 2025, 8:53 AM
F18851941: D21199.diff
Oct 31 2025, 5:30 AM
F18821856: D21199.id50483.diff
Oct 23 2025, 2:17 AM
F18809699: D21199.diff
Oct 19 2025, 4:15 PM
F18760097: D21199.id.diff
Oct 6 2025, 7:59 AM
Subscribers
None

Details

Summary

Ref T13528. If we start a subprocess that immediately exits and then write to it, we can get a broken pipe error.

Recent versions of PHP appear to raise this as an actual warning, and recent changes upgrade the warning to a runtime exception.

I can't find any way to tell if the RuntimeException is a broken pipe or something else, except by examining the text of the error string.

At least for now, treat this like a "blocked pipe" condition. Since the subprocess has exited and the bytes didn't write, this should generally be reasonable.

Test Plan
  • Viewed a file in Paste with an extension that Pygments does not have a lexer for.
  • This causes Pygments to exit immediately with an "unrecognized lexer" error. This closes the pipe, and the next write will fail with a broken pipe error.
  • Before patch: fatal on broken pipe.
  • After patch: clean resolution of the future and error condition.

Diff Detail

Repository
rARC Arcanist
Branch
future2
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24298
Build 33473: Run Core Tests
Build 33472: arc lint + arc unit

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.May 1 2020, 4:12 PM
This revision was automatically updated to reflect the committed changes.