You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by "Benjamin Mahler (JIRA)" <ji...@apache.org> on 2012/12/20 06:35:12 UTC

[jira] [Commented] (MESOS-319) Fix buggy read / write calls.

    [ https://issues.apache.org/jira/browse/MESOS-319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13536791#comment-13536791 ] 

Benjamin Mahler commented on MESOS-319:
---------------------------------------

Part 1 (os.hpp): https://reviews.apache.org/r/8694/
Part 2 (protobuf.hpp): https://reviews.apache.org/r/8695/
                
> 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