You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix race condition in result queue handling by using timeout-based get()
The previous implementation checked result_queue.empty() before calling get(),
which introduces a classic race condition: the queue may become non-empty
immediately after the check, resulting in missed results or misleading errors.
This patch replaces the empty() check with result_queue.get(timeout=1.0),
allowing the parent process to robustly wait for results with a bounded delay.
Also switches from ctx.SimpleQueue() to ctx.Queue() for compatibility with
timeout-based get(), which SimpleQueue does not support on Python ≤3.12.
Note: The race condition was discovered by Gemini 2.5
0 commit comments