fix: use is_alive() instead of TimeoutError for thread.join timeout

thread.join(timeout=N) never raises TimeoutError in Python — it always
returns None. Use thread.is_alive() after join to detect timeout.
This commit is contained in:
Zamil Majdy
2026-03-16 16:08:46 +07:00
parent ce68d97646
commit 8f1bf1d6f3

View File

@@ -1912,9 +1912,8 @@ class ExecutionManager(AppProcess):
channel = client.get_channel()
channel.connection.add_callback_threadsafe(lambda: channel.stop_consuming())
try:
thread.join(timeout=300)
except TimeoutError:
thread.join(timeout=300)
if thread.is_alive():
logger.warning(
f"{prefix} ⚠️ Run thread did not finish in time, forcing disconnect"
)