Skip to content

Commit 9098256

Browse files
authored
Report ExitFailures from cluster worker exits (#21)
1 parent 0b050b1 commit 9098256

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Internal/ContextClusterWorker.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ public function run(): void
109109
};
110110
}
111111

112-
$this->joinFuture->await(new TimeoutCancellation(ClusterWatcher::WORKER_TIMEOUT));
112+
try {
113+
$this->joinFuture->await(new TimeoutCancellation(ClusterWatcher::WORKER_TIMEOUT));
114+
} catch (CancelledException) {
115+
$this->close();
116+
// Give it a second to reap the result. Generally this never should time out, unless something is seriously broken.
117+
$this->joinFuture->await(new TimeoutCancellation(1));
118+
}
113119
} catch (\Throwable $exception) {
114120
$this->joinFuture->ignore();
115121
throw $exception;

0 commit comments

Comments
 (0)