Skip to content

Commit

Permalink
[python] Fixes python startup race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu committed Mar 30, 2023
1 parent 77bf5ad commit e46521d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,16 @@ synchronized void stopPythonProcess() {

void setStarted(boolean started, int id) {
if (restartCount.get() == id) {
this.started = started;
if (started) {
latch.countDown();
this.started = latch.getCount() == 0;
} else {
while (latch.getCount() > 0) {
latch.countDown();
}
}
} else {
logger.warn("Unexpected restartCount: {}, expect: {}", id, restartCount.get());
}
}

Expand Down

0 comments on commit e46521d

Please sign in to comment.