Skip to content

Commit

Permalink
Report ExitFailures from cluster worker exits
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed Dec 20, 2024
1 parent 0b050b1 commit 332ed6d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Internal/ContextClusterWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,16 @@ public function run(): void
};
}

$this->joinFuture->await(new TimeoutCancellation(ClusterWatcher::WORKER_TIMEOUT));
try {
$result = $this->joinFuture->await(new TimeoutCancellation(ClusterWatcher::WORKER_TIMEOUT));
} catch (CancelledException) {
$this->close();
// Give it a second to reap the result. Generally this never should time out, unless something is seriously broken.
$result = $this->joinFuture->await(new TimeoutCancellation(0.001));
}
if ($result instanceof \Throwable) {
throw $result;
}
} catch (\Throwable $exception) {
$this->joinFuture->ignore();
throw $exception;
Expand Down

0 comments on commit 332ed6d

Please sign in to comment.