| 602 | } |
| 603 | |
| 604 | void _recoveryTimeout(const string& failure) |
| 605 | { |
| 606 | // It's possible that a new connection was established since the timeout |
| 607 | // fired and we were unable to cancel this timeout. If this occurs, don't |
| 608 | // bother trying to shutdown the executor. |
| 609 | if (recoveryTimer.isNone() || !recoveryTimer->timeout().expired()) { |
| 610 | return; |
| 611 | } |
| 612 | |
| 613 | CHECK(state == DISCONNECTED || state == CONNECTING) << state; |
| 614 | |
| 615 | CHECK_SOME(recoveryTimeout); |
| 616 | LOG(INFO) << "Recovery timeout of " << recoveryTimeout.get() |
| 617 | << " exceeded following the first connection failure: " << failure |
| 618 | << "; Shutting down"; |
| 619 | |
| 620 | shutdown(); |
| 621 | } |
| 622 | |
| 623 | void disconnect() |
| 624 | { |