mesos-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam B (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MESOS-7020) cgroups::internal::write can incorrectly report success
Date Fri, 10 Feb 2017 07:21:41 GMT

     [ https://issues.apache.org/jira/browse/MESOS-7020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Adam B updated MESOS-7020:
--------------------------
    Fix Version/s:     (was: 1.3.0)
                   1.2.0

> cgroups::internal::write can incorrectly report success
> -------------------------------------------------------
>
>                 Key: MESOS-7020
>                 URL: https://issues.apache.org/jira/browse/MESOS-7020
>             Project: Mesos
>          Issue Type: Bug
>          Components: cgroups
>    Affects Versions: 1.2.0
>         Environment: CentOS7
>            Reporter: Dmitry Zhuk
>            Assignee: Jie Yu
>            Priority: Minor
>             Fix For: 1.2.0
>
>
> {{cgroups::internal::write}} does not flush stream before checking for errors after writing:
> {code}
>   ofstream file(path.c_str());
> ...
>   file << value;
>   if (file.fail()) {
>     // TODO(jieyu): Does ofstream actually set errno?
>     return ErrnoError();
>   }
> {code}
> Since {{ofstream}} does internal buffering, {{file.fail()}} can return {{false}}, as
value hasn't been written to file yet.
> Replacing {{file << value;}} with {{file << value << std::flush;}}
makes {{file.fail()}} behave as expected.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message