Add debug logging and 5min timeout per round to prevent hangs
This commit is contained in:
parent
65d8524a9d
commit
0ff30457a0
1 changed files with 12 additions and 3 deletions
|
|
@ -639,9 +639,18 @@ class RedditSimulationRunner:
|
|||
agent: LLMAction()
|
||||
for _, agent in active_agents
|
||||
}
|
||||
|
||||
await self.env.step(actions)
|
||||
|
||||
|
||||
print(f" Round {round_num+1}: stepping with {len(actions)} agents...", flush=True)
|
||||
try:
|
||||
await asyncio.wait_for(self.env.step(actions), timeout=300)
|
||||
except asyncio.TimeoutError:
|
||||
print(f" Round {round_num+1}: TIMEOUT after 300s, skipping", flush=True)
|
||||
continue
|
||||
except Exception as e:
|
||||
print(f" Round {round_num+1}: ERROR {type(e).__name__}: {e}", flush=True)
|
||||
continue
|
||||
print(f" Round {round_num+1}: step complete", flush=True)
|
||||
|
||||
if (round_num + 1) % 10 == 0 or round_num == 0:
|
||||
elapsed = (datetime.now() - start_time).total_seconds()
|
||||
progress = (round_num + 1) / total_rounds * 100
|
||||
|
|
|
|||
Loading…
Reference in a new issue