(actor) Try to rare data race where a finished job is considered dead.
This commit is contained in:
parent
562012fb22
commit
dd26819d66
1 changed files with 10 additions and 0 deletions
|
@ -73,6 +73,16 @@ public class ActorProcessWatcher {
|
||||||
|
|
||||||
// Maybe the process died, wait a moment for it to restart
|
// Maybe the process died, wait a moment for it to restart
|
||||||
if (!waitForProcess(processId, TimeUnit.SECONDS, 30)) {
|
if (!waitForProcess(processId, TimeUnit.SECONDS, 30)) {
|
||||||
|
|
||||||
|
// Check if the process has already responded, but we missed it
|
||||||
|
// This infrequently happens if we get unlucky with the timing of the process terminating
|
||||||
|
// and the polling thread...
|
||||||
|
|
||||||
|
var maybeResponse = outbox.pollResponse(msgId);
|
||||||
|
if (maybeResponse.isPresent()) {
|
||||||
|
return maybeResponse.get();
|
||||||
|
}
|
||||||
|
|
||||||
throw new ActorControlFlowException("Process " + processId + " died and did not re-launch");
|
throw new ActorControlFlowException("Process " + processId + " died and did not re-launch");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue