| 312 | } |
| 313 | |
| 314 | void finished(const Future<Option<RecoverResponse>>& future) |
| 315 | { |
| 316 | if (future.isDiscarded()) { |
| 317 | // We use the boolean flag 'terminating' to distinguish between |
| 318 | // a user initiated discard and a timeout induced discard. In |
| 319 | // the case of a user initiated discard, the flag 'terminating' |
| 320 | // will be set to true in 'Self::discard()'. |
| 321 | if (terminating) { |
| 322 | promise.discard(); |
| 323 | terminate(self()); |
| 324 | } else { |
| 325 | VLOG(2) << "Log recovery timed out waiting for responses, retrying"; |
| 326 | |
| 327 | start(); // Re-run the recover protocol after timeout. |
| 328 | } |
| 329 | } else if (future.isFailed()) { |
| 330 | promise.fail(future.failure()); |
| 331 | terminate(self()); |
| 332 | } else { |
| 333 | promise.set(future.get()); |
| 334 | terminate(self()); |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | const size_t quorum; |
| 339 | const Shared<Network> network; |