----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/64439/#review193318 -----------------------------------------------------------
src/resource_provider/daemon.cpp Lines 192 (patched) <https://reviews.apache.org/r/64439/#comment271880> The write is not atomic. To prevent from writting a file partially (e.g., agent crashes while writting the file), we should write to a temp location and then do a rename. The tmp file has to be in the same device as the final destination. Maybe we should create a `staging` directory under `configDir` and write the tmp file there and then do a rename. That also means that the daemon has to skip the `staging` directory. - Jie Yu On Dec. 8, 2017, 10 p.m., Chun-Hung Hsiao wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/64439/ > ----------------------------------------------------------- > > (Updated Dec. 8, 2017, 10 p.m.) > > > Review request for mesos, James DeFelice, Jie Yu, and Joseph Wu. > > > Bugs: MESOS-8244 > https://issues.apache.org/jira/browse/MESOS-8244 > > > Repository: mesos > > > Description > ------- > > The `add()` and `update()` methods adds a new config file and updates an > existing config file of a local resource provider respectively. It will > then trigger a rolead on the resource provider asynchronously. > > The `remove()` method removes the config file, and triggers the resource > provider to terminate asynchronously. > > > Diffs > ----- > > src/resource_provider/daemon.cpp 354054e8aab0131dcf4c47362975b11dfa96c16b > > > Diff: https://reviews.apache.org/r/64439/diff/3/ > > > Testing > ------- > > See later in the chain. > > > Thanks, > > Chun-Hung Hsiao > >