mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Park <mp...@apache.org>
Subject Re: Review Request 65022: Updated uses of `protobuf::read(path)` which now returns `Try<T>`.
Date Wed, 10 Jan 2018 22:17:03 GMT


> On Jan. 9, 2018, 5:49 p.m., Benjamin Mahler wrote:
> > Looks like we need to take a closer look at the change being made w.r.t. to the
none case now becoming an error.
> > 
> > Can you include vinod on this review?

Consulted Chun and Jie to audit this.

Since we introduced `state::checkpoint`, the atomic writes make it such that
handling of the `None` case became dead code. For example:

```cpp
  if (frameworkInfo.isNone()) {
    // This could happen if the slave died after opening the file for
    // writing but before it checkpointed anything.
    LOG(WARNING) << "Found empty framework info file '" << path << "'";
    return state;
  }
```

The unhandled `None` cases in new code (e.g., resource provider) is due to
the fact that we can't have an empty file.


In short, these changes are safe.


- Michael


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65022/#review195108
-----------------------------------------------------------


On Jan. 8, 2018, 10:14 a.m., Michael Park wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65022/
> -----------------------------------------------------------
> 
> (Updated Jan. 8, 2018, 10:14 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Chun-Hung Hsiao, and Vinod Kone.
> 
> 
> Bugs: MESOS-8375
>     https://issues.apache.org/jira/browse/MESOS-8375
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Since the path version of `protobuf::read` now returns `Try<T>`,
> many of the existing code is removed and/or simplified.
> 
> 
> Diffs
> -----
> 
>   src/resource_provider/storage/provider.cpp 55f2e662ecfc72bc93a7101537e7a0dc16f11522

>   src/slave/containerizer/mesos/paths.cpp d6ea618b20431ac95f880045143d09366f1740bf 
>   src/slave/containerizer/mesos/provisioner/docker/metadata_manager.cpp 1ab66c1a6d2ebe6e7a3382529c85fddfa72f79dc

>   src/slave/containerizer/mesos/provisioner/provisioner.cpp 7621c4960047e099953a26602ef34682a0ba8a2a

>   src/slave/state.cpp 5428b341b061c8209a5cfe63e17b71467d9f4c48 
>   src/tests/protobuf_io_tests.cpp 4a2e3a3bc87c1a3394368439e5dd30b410e468a4 
>   src/tests/slave_recovery_tests.cpp e305d7430b64409fdac84a33ee072707471d2c49 
> 
> 
> Diff: https://reviews.apache.org/r/65022/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Michael Park
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message