You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Benjamin Bannier (JIRA)" <ji...@apache.org> on 2018/10/17 20:45:00 UTC

[jira] [Created] (MESOS-9331) Some library functions ignore failures from ::close which should probably be handled.

Benjamin Bannier created MESOS-9331:
---------------------------------------

             Summary: Some library functions ignore failures from ::close which should probably be handled.
                 Key: MESOS-9331
                 URL: https://issues.apache.org/jira/browse/MESOS-9331
             Project: Mesos
          Issue Type: Bug
          Components: stout
            Reporter: Benjamin Bannier
            Assignee: Benjamin Bannier


Multiple functions e.g., in {{stout}} ignore the return value of {{::close}} with the following rationale,
{code:java}
// We ignore the return value of close(). This is because users
// calling this function are interested in the return value of
// write(). Also an unsuccessful close() doesn't affect the write.{code}
I believe this is incorrect in general. Especially when not calling {{::fsync}} after a write operation, the kernel might buffer writes and only trigger write-related failures when the file descriptor is closed.[here|[http://man7.org/linux/man-pages/man2/close.2.html#NOTES].]

We should audit our code to make sure that failures to {{::close}} file descriptors are properly propagated when needed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)