Re: Review Request 68304: Fixed a bug in the agent authentication retry logic.

2018-08-13 Thread Benjamin Mahler

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



Just a quick review since you're updating the logic.

How about:

```
Fixed a backoff overflow bug in agent authentication retry logic.
```

A little more in the commit description to clarify the old vs new approach 
would be nice for posterity (e.g. why did we decide to combine them?)


src/slave/slave.cpp
Lines 1375-1376 (patched)


Can you move this to `AUTHENTICATION_RETRY_INTERVAL_MIN` in the 
`slave/constants.hpp` and put the TODO to consider the flag there?


- Benjamin Mahler


On Aug. 13, 2018, 9:53 p.m., Meng Zhu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68304/
> ---
> 
> (Updated Aug. 13, 2018, 9:53 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Gastón Kleiman.
> 
> 
> Bugs: MESOS-9147
> https://issues.apache.org/jira/browse/MESOS-9147
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch fixed the backoff time calculation
> overflow bug described in MESOS-9147.
> 
> This patch also combines the authentication timeout and
> authentication retry backoff interval into a single
> wait time interval.
> 
> 
> Diffs
> -
> 
>   src/slave/slave.hpp 802d4eb9e9eba2f1175dd85e56dcc80a61e32f74 
>   src/slave/slave.cpp 78e8666f402be58af5b6e20a715da4998af2615c 
>   src/tests/authentication_tests.cpp c9a8f85951a50e278ae509f4efa7105755015ce9 
> 
> 
> Diff: https://reviews.apache.org/r/68304/diff/2/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>



Re: Review Request 68304: Fixed a bug in the agent authentication retry logic.

2018-08-13 Thread Meng Zhu


> On Aug. 13, 2018, 2:03 p.m., Gastón Kleiman wrote:
> > src/slave/slave.cpp
> > Line 1366 (original), 1383 (patched)
> > 
> >
> > Should we multiply `maxBackoff` by `2` here? I don't see it being 
> > increased anywhere else.

It is multiplied in `__authenticate()`:

```
  if (reauthenticate || !future.isReady()) {
LOG(WARNING)
  << "Failed to authenticate with master " << master.get() << ": "
  << (reauthenticate ? "master changed" :
 (future.isFailed() ? future.failure() : "future discarded"));

authenticating = None();
reauthenticate = false;

authenticate(maxBackoff * 2); // Retry.
return;
  }

```

I feel it is better to do the multiplication at the place where the failure 
occurs and retry starts.
I renamed the `maxBackoff` in `__authenticate()` to `currentMaxBackoff`. 
Hopefully it will improve the readibility.
Dropping.


- Meng


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


On Aug. 13, 2018, 2:53 p.m., Meng Zhu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68304/
> ---
> 
> (Updated Aug. 13, 2018, 2:53 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Gastón Kleiman.
> 
> 
> Bugs: MESOS-9147
> https://issues.apache.org/jira/browse/MESOS-9147
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch fixed the backoff time calculation
> overflow bug described in MESOS-9147.
> 
> This patch also combines the authentication timeout and
> authentication retry backoff interval into a single
> wait time interval.
> 
> 
> Diffs
> -
> 
>   src/slave/slave.hpp 802d4eb9e9eba2f1175dd85e56dcc80a61e32f74 
>   src/slave/slave.cpp 78e8666f402be58af5b6e20a715da4998af2615c 
>   src/tests/authentication_tests.cpp c9a8f85951a50e278ae509f4efa7105755015ce9 
> 
> 
> Diff: https://reviews.apache.org/r/68304/diff/2/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>



Re: Review Request 68304: Fixed a bug in the agent authentication retry logic.

2018-08-13 Thread Meng Zhu

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

(Updated Aug. 13, 2018, 2:53 p.m.)


Review request for mesos, Benjamin Mahler and Gastón Kleiman.


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


Repository: mesos


Description
---

This patch fixed the backoff time calculation
overflow bug described in MESOS-9147.

This patch also combines the authentication timeout and
authentication retry backoff interval into a single
wait time interval.


Diffs (updated)
-

  src/slave/slave.hpp 802d4eb9e9eba2f1175dd85e56dcc80a61e32f74 
  src/slave/slave.cpp 78e8666f402be58af5b6e20a715da4998af2615c 
  src/tests/authentication_tests.cpp c9a8f85951a50e278ae509f4efa7105755015ce9 


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

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


Testing
---

make check


Thanks,

Meng Zhu



Re: Review Request 68304: Fixed a bug in the agent authentication retry logic.

2018-08-13 Thread Gastón Kleiman

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




src/slave/slave.cpp
Line 1366 (original), 1383 (patched)


Should we multiply `maxBackoff` by `2` here? I don't see it being increased 
anywhere else.



src/slave/slave.cpp
Lines 1386-1387 (patched)


Nit: I would move this comment to before the if statement, and the note 
that is currently above to within it.


- Gastón Kleiman


On Aug. 10, 2018, 4:41 p.m., Meng Zhu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68304/
> ---
> 
> (Updated Aug. 10, 2018, 4:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Gastón Kleiman.
> 
> 
> Bugs: MESOS-9147
> https://issues.apache.org/jira/browse/MESOS-9147
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch fixed the backoff time calculation
> overflow bug described in MESOS-9147.
> 
> This patch also combines the authentication timeout and
> authentication retry backoff interval into a single
> wait time interval.
> 
> 
> Diffs
> -
> 
>   src/slave/slave.hpp 802d4eb9e9eba2f1175dd85e56dcc80a61e32f74 
>   src/slave/slave.cpp 78e8666f402be58af5b6e20a715da4998af2615c 
>   src/tests/authentication_tests.cpp c9a8f85951a50e278ae509f4efa7105755015ce9 
> 
> 
> Diff: https://reviews.apache.org/r/68304/diff/1/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>



Re: Review Request 68304: Fixed a bug in the agent authentication retry logic.

2018-08-13 Thread Mesos Reviewbot

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



Patch looks great!

Reviews applied: [68304]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' 
CONFIGURATION='--verbose --disable-libtool-wrappers' ENVIRONMENT='GLOG_v=1 
MESOS_VERBOSE=1'; ./support/docker-build.sh

- Mesos Reviewbot


On Aug. 10, 2018, 4:41 p.m., Meng Zhu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68304/
> ---
> 
> (Updated Aug. 10, 2018, 4:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Gastón Kleiman.
> 
> 
> Bugs: MESOS-9147
> https://issues.apache.org/jira/browse/MESOS-9147
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch fixed the backoff time calculation
> overflow bug described in MESOS-9147.
> 
> This patch also combines the authentication timeout and
> authentication retry backoff interval into a single
> wait time interval.
> 
> 
> Diffs
> -
> 
>   src/slave/slave.hpp 802d4eb9e9eba2f1175dd85e56dcc80a61e32f74 
>   src/slave/slave.cpp 78e8666f402be58af5b6e20a715da4998af2615c 
>   src/tests/authentication_tests.cpp c9a8f85951a50e278ae509f4efa7105755015ce9 
> 
> 
> Diff: https://reviews.apache.org/r/68304/diff/1/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>



Re: Review Request 68304: Fixed a bug in the agent authentication retry logic.

2018-08-10 Thread Mesos Reviewbot Windows

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



PASS: Mesos patch 68304 was successfully built and tested.

Reviews applied: `['68304']`

All the build artifacts available at: 
http://dcos-win.westus.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2134/mesos-review-68304

- Mesos Reviewbot Windows


On Aug. 10, 2018, 4:41 p.m., Meng Zhu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68304/
> ---
> 
> (Updated Aug. 10, 2018, 4:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Gastón Kleiman.
> 
> 
> Bugs: MESOS-9147
> https://issues.apache.org/jira/browse/MESOS-9147
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch fixed the backoff time calculation
> overflow bug described in MESOS-9147.
> 
> This patch also combines the authentication timeout and
> authentication retry backoff interval into a single
> wait time interval.
> 
> 
> Diffs
> -
> 
>   src/slave/slave.hpp 802d4eb9e9eba2f1175dd85e56dcc80a61e32f74 
>   src/slave/slave.cpp 78e8666f402be58af5b6e20a715da4998af2615c 
>   src/tests/authentication_tests.cpp c9a8f85951a50e278ae509f4efa7105755015ce9 
> 
> 
> Diff: https://reviews.apache.org/r/68304/diff/1/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>



Review Request 68304: Fixed a bug in the agent authentication retry logic.

2018-08-10 Thread Meng Zhu

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

Review request for mesos, Benjamin Mahler and Gastón Kleiman.


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


Repository: mesos


Description
---

This patch fixed the backoff time calculation
overflow bug described in MESOS-9147.

This patch also combines the authentication timeout and
authentication retry backoff interval into a single
wait time interval.


Diffs
-

  src/slave/slave.hpp 802d4eb9e9eba2f1175dd85e56dcc80a61e32f74 
  src/slave/slave.cpp 78e8666f402be58af5b6e20a715da4998af2615c 
  src/tests/authentication_tests.cpp c9a8f85951a50e278ae509f4efa7105755015ce9 


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


Testing
---

make check


Thanks,

Meng Zhu