Skip to content

Commit fd4a171

Browse files
author
Dylan Huang
committed
better error message
1 parent 08c8d9f commit fd4a171

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

eval_protocol/pytest/remote_rollout_processor.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,19 @@ async def _process_row(row: EvaluationRow) -> EvaluationRow:
121121
# Fire-and-poll
122122
def _post_init() -> None:
123123
url = f"{remote_base_url}/init"
124-
r = requests.post(url, json=init_payload.model_dump(), timeout=30)
125-
r.raise_for_status()
124+
try:
125+
r = requests.post(url, json=init_payload.model_dump(), timeout=30)
126+
r.raise_for_status()
127+
except requests.exceptions.Timeout:
128+
raise TimeoutError(
129+
"The /init endpoint timed out after 30 seconds. "
130+
"CRITICAL: The /init endpoint must return immediately (within 30s) and NOT block on rollout execution. "
131+
"Your remote server should:\n"
132+
"1. Accept the /init request and return a 200 response immediately\n"
133+
"2. Process the actual rollout asynchronously in the background\n"
134+
"3. Use the /status endpoint to report progress\n"
135+
"For Python/Node.js: Start a separate process per rollout to avoid blocking the /init response."
136+
)
126137

127138
await asyncio.to_thread(_post_init)
128139

0 commit comments

Comments
 (0)