| 425 | |
| 426 | |
| 427 | void CheckerProcess::processCheckResult( |
| 428 | const Stopwatch& stopwatch, |
| 429 | const Result<CheckStatusInfo>& result) |
| 430 | { |
| 431 | // `Checker` might have been paused while performing the check. |
| 432 | if (paused) { |
| 433 | LOG(INFO) << "Ignoring " << name << " result for" |
| 434 | << " task '" << taskId << "': checking is paused"; |
| 435 | return; |
| 436 | } |
| 437 | |
| 438 | // `result` will be: |
| 439 | // |
| 440 | // 1. `Some(CheckStatusInfo)` if it was possible to perform the check. |
| 441 | // 2. An `Error` if the check failed due to a non-transient error, |
| 442 | // e.g., timed out. |
| 443 | // 3. `None` if the check failed due to a transient error - this kind of |
| 444 | // failure will be silently ignored. |
| 445 | if (result.isSome()) { |
| 446 | // It was possible to perform the check. |
| 447 | VLOG(1) << "Performed " << name << " for task '" << taskId << "' in " |
| 448 | << stopwatch.elapsed(); |
| 449 | |
| 450 | updateCallback(result.get()); |
| 451 | } else if (result.isError()) { |
| 452 | // The check failed due to a non-transient error. |
| 453 | updateCallback(Error(result.error())); |
| 454 | } else { |
| 455 | // The check failed due to a transient error. |
| 456 | LOG(INFO) << name << " for task '" << taskId << "' is not available"; |
| 457 | } |
| 458 | |
| 459 | scheduleNext(checkInterval); |
| 460 | } |
| 461 | |
| 462 | |
| 463 | Future<int> CheckerProcess::commandCheck( |