Skip to content

Commit

Permalink
Begin refactoring RunEngineWorker, exposed race condition when stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
callumforrester committed Jun 1, 2023
1 parent aab9c0e commit 4876c9c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/blueapi/worker/reworker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import time
import uuid
from dataclasses import dataclass
from functools import partial
Expand Down Expand Up @@ -176,6 +177,9 @@ def _wait_until_stopped(self) -> None:
f"Worker did not stop within {self._start_stop_timeout} seconds"
)

if not self._stopped.wait(timeout=self._stop_timeout):
raise TimeoutError("Did not receive successful stop signal!")

@property
def state(self) -> WorkerState:
return self._state
Expand Down

0 comments on commit 4876c9c

Please sign in to comment.