Re: Review Request 65683: Updated discard handling in 'Docker::inspect()'.

2018-02-27 Thread Greg Mann

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

(Updated Feb. 27, 2018, 10:35 a.m.)


Review request for mesos, Andrei Budnik, Gilbert Song, Michael Park, and Vinod 
Kone.


Summary (updated)
-

Updated discard handling in 'Docker::inspect()'.


Bugs: MESOS-8575
https://issues.apache.org/jira/browse/MESOS-8575


Repository: mesos


Description (updated)
---

Updated discard handling in 'Docker::inspect()'.


Diffs (updated)
-

  src/docker/docker.hpp 0116ca8f28303905d80cd6b3a33a7a7feacc8f8a 
  src/docker/docker.cpp f7a4466292fcedd7e97740698475da2c616ca1d0 


Diff: https://reviews.apache.org/r/65683/diff/7/

Changes: https://reviews.apache.org/r/65683/diff/6-7/


Testing
---


Thanks,

Greg Mann



Re: Review Request 65683: Updated discard handling in 'Docker::inspect()'.

2018-02-27 Thread Andrei Budnik

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




src/docker/docker.cpp
Lines 1287-1288 (patched)


```
auto callback = make_shared, mutex>>();
```


- Andrei Budnik


On Feb. 27, 2018, 10:35 a.m., Greg Mann wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65683/
> ---
> 
> (Updated Feb. 27, 2018, 10:35 a.m.)
> 
> 
> Review request for mesos, Andrei Budnik, Gilbert Song, Michael Park, and 
> Vinod Kone.
> 
> 
> Bugs: MESOS-8575
> https://issues.apache.org/jira/browse/MESOS-8575
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Updated discard handling in 'Docker::inspect()'.
> 
> 
> Diffs
> -
> 
>   src/docker/docker.hpp 0116ca8f28303905d80cd6b3a33a7a7feacc8f8a 
>   src/docker/docker.cpp f7a4466292fcedd7e97740698475da2c616ca1d0 
> 
> 
> Diff: https://reviews.apache.org/r/65683/diff/7/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Greg Mann
> 
>



Re: Review Request 65683: Updated discard handling in 'Docker::inspect()'.

2018-02-27 Thread Michael Park

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


Ship it!




Ship It!

- Michael Park


On Feb. 27, 2018, 2:35 a.m., Greg Mann wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65683/
> ---
> 
> (Updated Feb. 27, 2018, 2:35 a.m.)
> 
> 
> Review request for mesos, Andrei Budnik, Gilbert Song, Michael Park, and 
> Vinod Kone.
> 
> 
> Bugs: MESOS-8575
> https://issues.apache.org/jira/browse/MESOS-8575
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Updated discard handling in 'Docker::inspect()'.
> 
> 
> Diffs
> -
> 
>   src/docker/docker.hpp 0116ca8f28303905d80cd6b3a33a7a7feacc8f8a 
>   src/docker/docker.cpp f7a4466292fcedd7e97740698475da2c616ca1d0 
> 
> 
> Diff: https://reviews.apache.org/r/65683/diff/7/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Greg Mann
> 
>



Re: Review Request 65683: Updated discard handling in 'Docker::inspect()'.

2018-02-27 Thread Gilbert Song

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


Ship it!




Ship It!

- Gilbert Song


On Feb. 27, 2018, 2:35 a.m., Greg Mann wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65683/
> ---
> 
> (Updated Feb. 27, 2018, 2:35 a.m.)
> 
> 
> Review request for mesos, Andrei Budnik, Gilbert Song, Michael Park, and 
> Vinod Kone.
> 
> 
> Bugs: MESOS-8575
> https://issues.apache.org/jira/browse/MESOS-8575
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Updated discard handling in 'Docker::inspect()'.
> 
> 
> Diffs
> -
> 
>   src/docker/docker.hpp 0116ca8f28303905d80cd6b3a33a7a7feacc8f8a 
>   src/docker/docker.cpp f7a4466292fcedd7e97740698475da2c616ca1d0 
> 
> 
> Diff: https://reviews.apache.org/r/65683/diff/7/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Greg Mann
> 
>



Re: Review Request 65683: Updated discard handling in 'Docker::inspect()'.

2018-02-28 Thread Greg Mann

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

(Updated Feb. 28, 2018, 8:49 a.m.)


Review request for mesos, Andrei Budnik, Gilbert Song, Michael Park, and Vinod 
Kone.


Changes
---

Addressed Andrei's comment.


Bugs: MESOS-8575
https://issues.apache.org/jira/browse/MESOS-8575


Repository: mesos


Description
---

Updated discard handling in 'Docker::inspect()'.


Diffs (updated)
-

  src/docker/docker.hpp 0116ca8f28303905d80cd6b3a33a7a7feacc8f8a 
  src/docker/docker.cpp f7a4466292fcedd7e97740698475da2c616ca1d0 


Diff: https://reviews.apache.org/r/65683/diff/8/

Changes: https://reviews.apache.org/r/65683/diff/7-8/


Testing
---


Thanks,

Greg Mann



Re: Review Request 65683: Updated discard handling in 'Docker::inspect()'.

2018-02-28 Thread Andrei Budnik

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


Ship it!




Ship It!

- Andrei Budnik


On Feb. 28, 2018, 8:49 a.m., Greg Mann wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65683/
> ---
> 
> (Updated Feb. 28, 2018, 8:49 a.m.)
> 
> 
> Review request for mesos, Andrei Budnik, Gilbert Song, Michael Park, and 
> Vinod Kone.
> 
> 
> Bugs: MESOS-8575
> https://issues.apache.org/jira/browse/MESOS-8575
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Updated discard handling in 'Docker::inspect()'.
> 
> 
> Diffs
> -
> 
>   src/docker/docker.hpp 0116ca8f28303905d80cd6b3a33a7a7feacc8f8a 
>   src/docker/docker.cpp f7a4466292fcedd7e97740698475da2c616ca1d0 
> 
> 
> Diff: https://reviews.apache.org/r/65683/diff/8/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Greg Mann
> 
>



Re: Review Request 65683: Updated discard handling in 'Docker::inspect()'.

2018-02-28 Thread Greg Mann

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

(Updated Feb. 28, 2018, 11:49 p.m.)


Review request for mesos, Andrei Budnik, Gilbert Song, Michael Park, and Vinod 
Kone.


Bugs: MESOS-8576
https://issues.apache.org/jira/browse/MESOS-8576


Repository: mesos


Description
---

Updated discard handling in `Docker::inspect()`.

Previously, discards of the `Future` returned by `Docker::inspect()`
were only handled at the beginning of each asynchronous continuation
in the library function's call chain. This meant that if a Docker
CLI command became stuck in between async calls, discarding the
`Future` would have no effect.

This patch adds an `onDiscard` callback to the `Future` to ensure
that any discards have the desired effect: cleanup of any spawned
subprocess, and a transition of the `Future` to the discarded state.

Since the Docker library is not a libprocess process, we must
implement this with a `shared_ptr` and a mutex, to protect against
concurrent access to the `onDiscard` callback, which must be updated
when retries are performed.


Diffs
-

  src/docker/docker.hpp 0116ca8f28303905d80cd6b3a33a7a7feacc8f8a 
  src/docker/docker.cpp f7a4466292fcedd7e97740698475da2c616ca1d0 


Diff: https://reviews.apache.org/r/65683/diff/8/


Testing
---

sudo bin/mesos-tests.sh --gtest_filter="*DOCKER*"


Thanks,

Greg Mann



Re: Review Request 65683: Updated discard handling in 'Docker::inspect()'.

2018-02-28 Thread Greg Mann

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

(Updated Feb. 28, 2018, 11:48 p.m.)


Review request for mesos, Andrei Budnik, Gilbert Song, Michael Park, and Vinod 
Kone.


Bugs: MESOS-8575
https://issues.apache.org/jira/browse/MESOS-8575


Repository: mesos


Description (updated)
---

Updated discard handling in `Docker::inspect()`.

Previously, discards of the `Future` returned by `Docker::inspect()`
were only handled at the beginning of each asynchronous continuation
in the library function's call chain. This meant that if a Docker
CLI command became stuck in between async calls, discarding the
`Future` would have no effect.

This patch adds an `onDiscard` callback to the `Future` to ensure
that any discards have the desired effect: cleanup of any spawned
subprocess, and a transition of the `Future` to the discarded state.

Since the Docker library is not a libprocess process, we must
implement this with a `shared_ptr` and a mutex, to protect against
concurrent access to the `onDiscard` callback, which must be updated
when retries are performed.


Diffs
-

  src/docker/docker.hpp 0116ca8f28303905d80cd6b3a33a7a7feacc8f8a 
  src/docker/docker.cpp f7a4466292fcedd7e97740698475da2c616ca1d0 


Diff: https://reviews.apache.org/r/65683/diff/8/


Testing (updated)
---

sudo bin/mesos-tests.sh --gtest_filter="*DOCKER*"


Thanks,

Greg Mann



Re: Review Request 65683: Updated discard handling in `Docker::inspect()`.

2018-02-28 Thread Greg Mann

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

(Updated March 1, 2018, 12:07 a.m.)


Review request for mesos, Andrei Budnik, Gilbert Song, Michael Park, and Vinod 
Kone.


Changes
---

Added a missing CHECK guard.


Summary (updated)
-

Updated discard handling in `Docker::inspect()`.


Bugs: MESOS-8576
https://issues.apache.org/jira/browse/MESOS-8576


Repository: mesos


Description (updated)
---

Previously, discards of the `Future` returned by `Docker::inspect()`
were only handled at the beginning of each asynchronous continuation
in the library function's call chain. This meant that if a Docker
CLI command became stuck in between async calls, discarding the
`Future` would have no effect.

This patch adds an `onDiscard` callback to the `Future` to ensure
that any discards have the desired effect: cleanup of any spawned
subprocess, and a transition of the `Future` to the discarded state.

Since the Docker library is not a libprocess process, we must
implement this with a `shared_ptr` and a mutex, to protect against
concurrent access to the `onDiscard` callback, which must be updated
when retries are performed.


Diffs (updated)
-

  src/docker/docker.hpp 0116ca8f28303905d80cd6b3a33a7a7feacc8f8a 
  src/docker/docker.cpp f7a4466292fcedd7e97740698475da2c616ca1d0 


Diff: https://reviews.apache.org/r/65683/diff/9/

Changes: https://reviews.apache.org/r/65683/diff/8-9/


Testing (updated)
---

sudo bin/mesos-tests.sh --gtest_filter="*DOCKER*"


Thanks,

Greg Mann