Skip to content

Commit 05a4d74

Browse files
committed
refactor: improve logging level for episode registration exit warning
1 parent d10b5bc commit 05a4d74

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

ajet/task_rollout/single_worker.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Single worker primitives for environment rollouts."""
22

33
import uuid
4+
import time
45
import threading
56
from typing import Literal
67

@@ -168,7 +169,6 @@ def rollout_env_worker_loop(
168169
cnt = 1
169170

170171
while True:
171-
172172
if observation_window["stop"][task_thread_index]: # since we use multi-threading, the best way to communicate with main thread is through shared memory.
173173
observation_window["info"][task_thread_index] += f"[thread {task_thread_index} observe stop, returning]\n"
174174
return
@@ -205,10 +205,9 @@ def rollout_env_worker_loop(
205205
observation_window["info"][task_thread_index] += f"[thread {task_thread_index} observe stop, returning]\n"
206206
return
207207
else:
208+
time.sleep(0) # be nice to other threads
208209
continue
209210

210211
except Exception as e:
211-
logger.exception(
212-
f"encounter exception in env_worker_loop error={e.args}"
213-
)
212+
logger.exception(f"encounter exception in env_worker_loop error={e.args}")
214213
raise e

ajet/tuner_lib/experimental/interchange_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def http_register_episode(config,
158158
should_exit_soft):
159159

160160
if should_exit_soft():
161-
logger.warning(f"Exiting before registering episode {episode_uuid}")
161+
logger.debug(f"Exiting before registering episode {episode_uuid}")
162162
return None
163163

164164
# parse episode_uuid, openai_base_url, openai_api_key

0 commit comments

Comments
 (0)