Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15481199
D20083.id.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
D20083.id.diff
View Options
diff --git a/src/utils/utils.php b/src/utils/utils.php
--- a/src/utils/utils.php
+++ b/src/utils/utils.php
@@ -1010,11 +1010,26 @@
// the stream, write to it again if PHP claims that it's writable, and
// consider the pipe broken if the write fails.
+ // (Signals received signals during the "fwrite()" do not appear to affect
+ // anything, see D20083.)
+
$read = array();
$write = array($stream);
$except = array();
- @stream_select($read, $write, $except, 0);
+ $result = @stream_select($read, $write, $except, 0);
+ if ($result === false) {
+ // See T13243. If the select is interrupted by a signal, it may return
+ // "false" indicating an underlying EINTR condition. In this case, the
+ // results (notably, "$write") are not usable because "stream_select()"
+ // didn't update them.
+
+ // In this case, treat this stream as blocked and tell the caller to
+ // retry, since EINTR is the only condition we're currently aware of that
+ // can cause "fwrite()" to return "0" and "stream_select()" to return
+ // "false" on the same stream.
+ return 0;
+ }
if (!$write) {
// The stream isn't writable, so we conclude that it probably really is
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 9, 7:00 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7729554
Default Alt Text
D20083.id.diff (1 KB)
Attached To
Mode
D20083: Recover from rare EINTR signal interruptions during "stream_select(..., 0)"
Attached
Detach File
Event Timeline
Log In to Comment