Benjamin Mahler created MESOS-319:
-------------------------------------

             Summary: Fix buggy read / write calls.
                 Key: MESOS-319
                 URL: https://issues.apache.org/jira/browse/MESOS-319
             Project: Mesos
          Issue Type: Bug
            Reporter: Benjamin Mahler
            Assignee: Benjamin Mahler


We don't handle EINTR and partial read / write calls.

See my comment below from https://reviews.apache.org/r/8423/

"POSIX allows a read() that is interrupted after reading some data to return -1 
(with errno set to EINTR) or to return the number of bytes already read."

Therefore, we need to handle both EINTR and partial reads (with a read loop).
Keeping this in the os.hpp read/write helpers would make things easier (I see 
the same mistake made there).

Added TODOs for now, and at some point I'd like to fix these.

Likewise for write:
"Conforming to
SVr4, 4.3BSD, POSIX.1-2001.
Under SVr4 a write may be interrupted and return EINTR at any point, not just 
before any data is written.

Notes
<snip>
If a write() is interrupted by a signal handler before any bytes are written, 
then the call fails with the error EINTR; if it is interrupted after at least 
one byte has been written, the call succeeds, and returns the number of bytes 
written."

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to