Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-04 Thread Greg Mann

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


Ship it!




Ship It!

- Greg Mann


On Oct. 4, 2018, 10:02 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68866/
> ---
> 
> (Updated Oct. 4, 2018, 10:02 a.m.)
> 
> 
> Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.
> 
> 
> Bugs: MESOS-9274
> https://issues.apache.org/jira/browse/MESOS-9274
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Destruction of the library is not always under our control. For
> example, the JVM can call JNI `finalize()` if the Java scheduler
> nullifies its reference to the V1Mesos library immediately after
> sending `TEARDOWN`. We want to make sure that `TEARDOWN` is sent
> before the Mesos library is destructed.
> 
> 
> Diffs
> -
> 
>   src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
> 2a5fbd79ac7bad933067cd96e38186849af8edc4 
> 
> 
> Diff: https://reviews.apache.org/r/68866/diff/4/
> 
> 
> Testing
> ---
> 
> `make check` on various Linux distro
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-04 Thread Mesos Reviewbot Windows

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



PASS: Mesos patch 68866 was successfully built and tested.

Reviews applied: `['68865', '68866']`

All the build artifacts available at: 
http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2419/mesos-review-68866

- Mesos Reviewbot Windows


On Oct. 4, 2018, 10:02 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68866/
> ---
> 
> (Updated Oct. 4, 2018, 10:02 a.m.)
> 
> 
> Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.
> 
> 
> Bugs: MESOS-9274
> https://issues.apache.org/jira/browse/MESOS-9274
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Destruction of the library is not always under our control. For
> example, the JVM can call JNI `finalize()` if the Java scheduler
> nullifies its reference to the V1Mesos library immediately after
> sending `TEARDOWN`. We want to make sure that `TEARDOWN` is sent
> before the Mesos library is destructed.
> 
> 
> Diffs
> -
> 
>   src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
> 2a5fbd79ac7bad933067cd96e38186849af8edc4 
> 
> 
> Diff: https://reviews.apache.org/r/68866/diff/4/
> 
> 
> Testing
> ---
> 
> `make check` on various Linux distro
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-04 Thread Alexander Rukletsov

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

(Updated Oct. 4, 2018, 10:02 a.m.)


Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.


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


Repository: mesos


Description
---

Destruction of the library is not always under our control. For
example, the JVM can call JNI `finalize()` if the Java scheduler
nullifies its reference to the V1Mesos library immediately after
sending `TEARDOWN`. We want to make sure that `TEARDOWN` is sent
before the Mesos library is destructed.


Diffs (updated)
-

  src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
2a5fbd79ac7bad933067cd96e38186849af8edc4 


Diff: https://reviews.apache.org/r/68866/diff/4/

Changes: https://reviews.apache.org/r/68866/diff/3-4/


Testing
---

`make check` on various Linux distro


Thanks,

Alexander Rukletsov



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-04 Thread Alexander Rukletsov

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

(Updated Oct. 4, 2018, 9:42 a.m.)


Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.


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


Repository: mesos


Description
---

Destruction of the library is not always under our control. For
example, the JVM can call JNI `finalize()` if the Java scheduler
nullifies its reference to the V1Mesos library immediately after
sending `TEARDOWN`. We want to make sure that `TEARDOWN` is sent
before the Mesos library is destructed.


Diffs (updated)
-

  src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
2a5fbd79ac7bad933067cd96e38186849af8edc4 


Diff: https://reviews.apache.org/r/68866/diff/3/

Changes: https://reviews.apache.org/r/68866/diff/2-3/


Testing
---

`make check` on various Linux distro


Thanks,

Alexander Rukletsov



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-04 Thread Alexander Rukletsov

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

(Updated Oct. 4, 2018, 9:39 a.m.)


Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.


Changes
---

Addressed feedback.


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


Repository: mesos


Description
---

Destruction of the library is not always under our control. For
example, the JVM can call JNI `finalize()` if the Java scheduler
nullifies its reference to the V1Mesos library immediately after
sending `TEARDOWN`. We want to make sure that `TEARDOWN` is sent
before the Mesos library is destructed.


Diffs (updated)
-

  src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
2a5fbd79ac7bad933067cd96e38186849af8edc4 


Diff: https://reviews.apache.org/r/68866/diff/2/

Changes: https://reviews.apache.org/r/68866/diff/1-2/


Testing (updated)
---

`make check` on various Linux distro


Thanks,

Alexander Rukletsov



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-04 Thread Alexander Rukletsov

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

(Updated Oct. 4, 2018, 9:33 a.m.)


Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.


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


Repository: mesos


Description (updated)
---

Destruction of the library is not always under our control. For
example, the JVM can call JNI `finalize()` if the Java scheduler
nullifies its reference to the V1Mesos library immediately after
sending `TEARDOWN`. We want to make sure that `TEARDOWN` is sent
before the Mesos library is destructed.


Diffs
-

  src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
2a5fbd79ac7bad933067cd96e38186849af8edc4 


Diff: https://reviews.apache.org/r/68866/diff/1/


Testing
---

`make check`on various Linux distro


Thanks,

Alexander Rukletsov



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-03 Thread Vinod Kone

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


Ship it!




Ship It!

- Vinod Kone


On Sept. 27, 2018, 5:41 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68866/
> ---
> 
> (Updated Sept. 27, 2018, 5:41 p.m.)
> 
> 
> Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.
> 
> 
> Bugs: MESOS-9274
> https://issues.apache.org/jira/browse/MESOS-9274
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
> 2a5fbd79ac7bad933067cd96e38186849af8edc4 
> 
> 
> Diff: https://reviews.apache.org/r/68866/diff/1/
> 
> 
> Testing
> ---
> 
> `make check`on various Linux distro
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-03 Thread Vinod Kone


> On Sept. 27, 2018, 6:23 p.m., Vinod Kone wrote:
> > src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp
> > Lines 294 (patched)
> > 
> >
> > Looks like you are doing `call` here instead of `send` so that you have 
> > a future to wait on? Skipping `send` which does validation and 
> > authentication seems wrong. Let's not do that.
> > 
> > I would recommend putting a sleep in the client code instead of here 
> > for now.
> 
> Alexander Rukletsov wrote:
> But `call` does 
> [validation](https://github.com/apache/mesos/blob/6e21e94ddca5b776d44636fe3eba8500bf88dc25/src/scheduler/scheduler.cpp#L269-L270)
>  and 
> [authentication](https://github.com/apache/mesos/blob/6e21e94ddca5b776d44636fe3eba8500bf88dc25/src/scheduler/scheduler.cpp#L301)
>  too. Not sure I follow, Vinod.
> 
> Greg Mann wrote:
> Yea I think we have the necessary validation/authentication in the 
> `call()` path as well. This solution is nice because it will wait for as 
> little time as possible, up to 5 seconds, rather than always waiting for 5 
> seconds.
> 
> In fact, since this code will return early if a response is actually 
> received, I would feel comfortable with a slightly longer await - maybe 10 or 
> 20 seconds?

I didn't realize `call` was a newish interface method added to the library. At 
a quick glance I thought it was the continuation of `send` and an internal 
method. My bad.

So I'm ok with doing a `call` here.

Suggestion: The comment above doesn't have enough context for a future to 
understand why the library could be destructured. I would recommend expanding 
the comment a bit more explaining. For example "The JVM could potentially call 
JNI `finalize` if the Java scheduler nullified its reference to `V1Mesos` 
library immediately after sending TEARDOWN." Also, maybe link to MESOS-9274 for 
posterity.


- Vinod


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


On Sept. 27, 2018, 5:41 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68866/
> ---
> 
> (Updated Sept. 27, 2018, 5:41 p.m.)
> 
> 
> Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.
> 
> 
> Bugs: MESOS-9274
> https://issues.apache.org/jira/browse/MESOS-9274
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
> 2a5fbd79ac7bad933067cd96e38186849af8edc4 
> 
> 
> Diff: https://reviews.apache.org/r/68866/diff/1/
> 
> 
> Testing
> ---
> 
> `make check`on various Linux distro
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-02 Thread Greg Mann

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




src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp
Lines 293-294 (patched)


If we end up waiting the entire timeout without receiving a response, I 
think we should log an error. WDYT?


- Greg Mann


On Sept. 27, 2018, 5:41 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68866/
> ---
> 
> (Updated Sept. 27, 2018, 5:41 p.m.)
> 
> 
> Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.
> 
> 
> Bugs: MESOS-9274
> https://issues.apache.org/jira/browse/MESOS-9274
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
> 2a5fbd79ac7bad933067cd96e38186849af8edc4 
> 
> 
> Diff: https://reviews.apache.org/r/68866/diff/1/
> 
> 
> Testing
> ---
> 
> `make check`on various Linux distro
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-10-02 Thread Greg Mann


> On Sept. 27, 2018, 6:23 p.m., Vinod Kone wrote:
> > src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp
> > Lines 294 (patched)
> > 
> >
> > Looks like you are doing `call` here instead of `send` so that you have 
> > a future to wait on? Skipping `send` which does validation and 
> > authentication seems wrong. Let's not do that.
> > 
> > I would recommend putting a sleep in the client code instead of here 
> > for now.
> 
> Alexander Rukletsov wrote:
> But `call` does 
> [validation](https://github.com/apache/mesos/blob/6e21e94ddca5b776d44636fe3eba8500bf88dc25/src/scheduler/scheduler.cpp#L269-L270)
>  and 
> [authentication](https://github.com/apache/mesos/blob/6e21e94ddca5b776d44636fe3eba8500bf88dc25/src/scheduler/scheduler.cpp#L301)
>  too. Not sure I follow, Vinod.

Yea I think we have the necessary validation/authentication in the `call()` 
path as well. This solution is nice because it will wait for as little time as 
possible, up to 5 seconds, rather than always waiting for 5 seconds.

In fact, since this code will return early if a response is actually received, 
I would feel comfortable with a slightly longer await - maybe 10 or 20 seconds?


- Greg


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


On Sept. 27, 2018, 5:41 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68866/
> ---
> 
> (Updated Sept. 27, 2018, 5:41 p.m.)
> 
> 
> Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.
> 
> 
> Bugs: MESOS-9274
> https://issues.apache.org/jira/browse/MESOS-9274
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
> 2a5fbd79ac7bad933067cd96e38186849af8edc4 
> 
> 
> Diff: https://reviews.apache.org/r/68866/diff/1/
> 
> 
> Testing
> ---
> 
> `make check`on various Linux distro
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-09-28 Thread Alexander Rukletsov


> On Sept. 27, 2018, 6:23 p.m., Vinod Kone wrote:
> > src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp
> > Lines 294 (patched)
> > 
> >
> > Looks like you are doing `call` here instead of `send` so that you have 
> > a future to wait on? Skipping `send` which does validation and 
> > authentication seems wrong. Let's not do that.
> > 
> > I would recommend putting a sleep in the client code instead of here 
> > for now.

But `call` does 
[validation](https://github.com/apache/mesos/blob/6e21e94ddca5b776d44636fe3eba8500bf88dc25/src/scheduler/scheduler.cpp#L269-L270)
 and 
[authentication](https://github.com/apache/mesos/blob/6e21e94ddca5b776d44636fe3eba8500bf88dc25/src/scheduler/scheduler.cpp#L301)
 too. Not sure I follow, Vinod.


- Alexander


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


On Sept. 27, 2018, 5:41 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68866/
> ---
> 
> (Updated Sept. 27, 2018, 5:41 p.m.)
> 
> 
> Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.
> 
> 
> Bugs: MESOS-9274
> https://issues.apache.org/jira/browse/MESOS-9274
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
> 2a5fbd79ac7bad933067cd96e38186849af8edc4 
> 
> 
> Diff: https://reviews.apache.org/r/68866/diff/1/
> 
> 
> Testing
> ---
> 
> `make check`on various Linux distro
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-09-27 Thread Vinod Kone

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




src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp
Lines 294 (patched)


Looks like you are doing `call` here instead of `send` so that you have a 
future to wait on? Skipping `send` which does validation and authentication 
seems wrong. Let's not do that.

I would recommend putting a sleep in the client code instead of here for 
now.


- Vinod Kone


On Sept. 27, 2018, 5:41 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68866/
> ---
> 
> (Updated Sept. 27, 2018, 5:41 p.m.)
> 
> 
> Review request for mesos, Gastón Kleiman, Greg Mann, and Nicholas Parker.
> 
> 
> Bugs: MESOS-9274
> https://issues.apache.org/jira/browse/MESOS-9274
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
> 2a5fbd79ac7bad933067cd96e38186849af8edc4 
> 
> 
> Diff: https://reviews.apache.org/r/68866/diff/1/
> 
> 
> Testing
> ---
> 
> `make check`on various Linux distro
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-09-27 Thread Alexander Rukletsov

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

(Updated Sept. 27, 2018, 5:41 p.m.)


Review request for mesos, Greg Mann and Nicholas Parker.


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


Repository: mesos


Description
---

See summary.


Diffs
-

  src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
2a5fbd79ac7bad933067cd96e38186849af8edc4 


Diff: https://reviews.apache.org/r/68866/diff/1/


Testing (updated)
---

`make check`on various Linux distro


Thanks,

Alexander Rukletsov



Re: Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-09-27 Thread Mesos Reviewbot Windows

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



PASS: Mesos patch 68866 was successfully built and tested.

Reviews applied: `['68865', '68866']`

All the build artifacts available at: 
http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2402/mesos-review-68866

- Mesos Reviewbot Windows


On Sept. 27, 2018, 2:48 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68866/
> ---
> 
> (Updated Sept. 27, 2018, 2:48 p.m.)
> 
> 
> Review request for mesos, Greg Mann and Nicholas Parker.
> 
> 
> Bugs: MESOS-9274
> https://issues.apache.org/jira/browse/MESOS-9274
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary.
> 
> 
> Diffs
> -
> 
>   src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
> 2a5fbd79ac7bad933067cd96e38186849af8edc4 
> 
> 
> Diff: https://reviews.apache.org/r/68866/diff/1/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Review Request 68866: Waited for TEARDOWN response in v1 Java scheduler shim.

2018-09-27 Thread Alexander Rukletsov

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

Review request for mesos, Greg Mann and Nicholas Parker.


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


Repository: mesos


Description
---

See summary.


Diffs
-

  src/java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp 
2a5fbd79ac7bad933067cd96e38186849af8edc4 


Diff: https://reviews.apache.org/r/68866/diff/1/


Testing
---


Thanks,

Alexander Rukletsov