mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(batch_runner): log traceback when worker raises during imap_unordered
If any worker raises inside pool.imap_unordered(), the exception propagates through the for loop and the results list is left incomplete. The finally block correctly restores the log level but the error is swallowed with no diagnostic information. Added an explicit except block that logs the full traceback via exc_info=True before re-raising, making batch worker failures visible in logs without changing the existing control flow.
This commit is contained in:
parent
bd8b20b933
commit
c574a4d086
1 changed files with 3 additions and 0 deletions
|
|
@ -914,6 +914,9 @@ class BatchRunner:
|
||||||
for result in pool.imap_unordered(_process_batch_worker, tasks):
|
for result in pool.imap_unordered(_process_batch_worker, tasks):
|
||||||
results.append(result)
|
results.append(result)
|
||||||
progress.update(task, advance=1)
|
progress.update(task, advance=1)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error("Batch worker failed: %s", e, exc_info=True)
|
||||||
|
raise
|
||||||
finally:
|
finally:
|
||||||
root_logger.setLevel(original_level)
|
root_logger.setLevel(original_level)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue