Skip to content

Commit 332ed6d

Browse files
committed
Report ExitFailures from cluster worker exits
1 parent 0b050b1 commit 332ed6d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Internal/ContextClusterWorker.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,16 @@ public function run(): void
109109
};
110110
}
111111

112-
$this->joinFuture->await(new TimeoutCancellation(ClusterWatcher::WORKER_TIMEOUT));
112+
try {
113+
$result = $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+
$result = $this->joinFuture->await(new TimeoutCancellation(0.001));
118+
}
119+
if ($result instanceof \Throwable) {
120+
throw $result;
121+
}
113122
} catch (\Throwable $exception) {
114123
$this->joinFuture->ignore();
115124
throw $exception;

0 commit comments

Comments
 (0)