Meng Zhu created MESOS-9147:
-------------------------------

             Summary: Agent and scheduler driver authentication retry backoff 
time calculation could overflow.
                 Key: MESOS-9147
                 URL: https://issues.apache.org/jira/browse/MESOS-9147
             Project: Mesos
          Issue Type: Bug
    Affects Versions: 1.6.1, 1.5.1
            Reporter: Meng Zhu
            Assignee: Meng Zhu


In the agent we have the following retry backoff calculation logic:

https://github.com/apache/mesos/blob/874c752316b14055c0a5a7b67f97ccf912abcc3c/src/slave/slave.cpp#L1401-L1418

{code:c++}
    Duration backoff =
      flags.authentication_backoff_factor * std::pow(2, failedAuthentications);
{code}

Since the `Duration` uses `int64_t` to hold nanosecond, if we set the 
`authentication_backoff_factor` to 1 second, we will overflow after 34 failed 
authentications (from second to nanosecond we lose 30 bits and 2^34 in the 
`pow()`).

The effect is we do not backoff at all, we will just retry immediately after 
the 5s timeout:
https://github.com/apache/mesos/blob/874c752316b14055c0a5a7b67f97ccf912abcc3c/src/master/master.cpp#L9615-L9619

The scheduler driver also has the same issue.

We should also audit all the other backoff logic.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to