| 1338 | |
| 1339 | |
| 1340 | void CheckerProcess::processTcpCheckResult( |
| 1341 | const Stopwatch& stopwatch, |
| 1342 | const Future<bool>& future) |
| 1343 | { |
| 1344 | CHECK(!future.isPending()); |
| 1345 | |
| 1346 | Result<CheckStatusInfo> result = None(); |
| 1347 | |
| 1348 | if (future.isReady()) { |
| 1349 | LOG(INFO) << name << " for task '" << taskId << "'" |
| 1350 | << " returned: " << future.get(); |
| 1351 | |
| 1352 | CheckStatusInfo checkStatusInfo; |
| 1353 | checkStatusInfo.set_type(CheckInfo::TCP); |
| 1354 | checkStatusInfo.mutable_tcp()->set_succeeded(future.get()); |
| 1355 | |
| 1356 | result = Result<CheckStatusInfo>(checkStatusInfo); |
| 1357 | } else if (future.isDiscarded()) { |
| 1358 | // Check's status is currently not available due to a transient error, |
| 1359 | // e.g., due to the agent failover, no `CheckStatusInfo` message should |
| 1360 | // be sent to the callback. |
| 1361 | result = None(); |
| 1362 | } else { |
| 1363 | result = Result<CheckStatusInfo>(Error(future.failure())); |
| 1364 | } |
| 1365 | |
| 1366 | processCheckResult(stopwatch, result); |
| 1367 | } |
| 1368 | |
| 1369 | |
| 1370 | #ifdef __WINDOWS__ |