Skip to content

Commit

Permalink
fix: Probe module waits for ready signal in another thread to avoid h…
Browse files Browse the repository at this point in the history
…angs (#108)

NOTE: This may not be a full fix, as asyncio objects technically aren't thread-safe, but it works well enough for now.

Signed-off-by: Valentin Dimov <[email protected]>
  • Loading branch information
valentin-dimov authored Dec 4, 2023
1 parent 53c5fdf commit f673ca4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ async def wait_to_be_ready(self, timeout=3):
if not self._started:
raise RuntimeError("Called wait_to_be_ready(), but probe module has not been started yet! "
"Please use start() to start the module first.")
await asyncio.wait_for(self._ready_event.wait(), timeout)
await asyncio.wait_for(asyncio.to_thread(self._ready_event.wait), timeout)

0 comments on commit f673ca4

Please sign in to comment.