Skip to content

Commit

Permalink
[runtime env] Improve runtime env timeout log (#44344)
Browse files Browse the repository at this point in the history
When a runtime env hits a timeout, the current error message doesn't show the provided timeout, and is confusing (it seems to imply the default timeout was used, even if it wasn't.) This PR clarifies the error message.

---------

Signed-off-by: Archit Kulkarni <[email protected]>
  • Loading branch information
architkulkarni committed Apr 4, 2024
1 parent c54dc5c commit e8dd54e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dashboard/modules/job/tests/test_http_job_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def test_timeout(job_sdk_client):
data = client.get_job_info(job_id)
assert "Failed to set up runtime environment" in data.message
assert "Timeout" in data.message
assert "consider increasing `setup_timeout_seconds`" in data.message
assert "setup_timeout_seconds" in data.message


def test_per_task_runtime_env(job_sdk_client: JobSubmissionClient):
Expand Down
2 changes: 1 addition & 1 deletion dashboard/modules/job/tests/test_job_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ async def test_timeout(job_sdk_client):
data = head_client.get_job_info(job_id)
assert "Failed to set up runtime environment" in data.message
assert "Timeout" in data.message
assert "consider increasing `setup_timeout_seconds`" in data.message
assert "setup_timeout_seconds" in data.message


@pytest.mark.asyncio
Expand Down
8 changes: 5 additions & 3 deletions python/ray/_private/runtime_env/agent/runtime_env_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,14 @@ async def _create_runtime_env_with_retry(
)
if isinstance(e, asyncio.TimeoutError):
hint = (
f"Failed due to timeout; check runtime_env setup logs"
" and consider increasing `setup_timeout_seconds` beyond "
f"the default of {DEFAULT_RUNTIME_ENV_TIMEOUT_SECONDS}."
f"Failed to install runtime_env within the "
f"timeout of {setup_timeout_seconds} seconds. Consider "
"increasing the timeout in the runtime_env config. "
"For example: \n"
' runtime_env={"config": {"setup_timeout_seconds":'
" 1800}, ...}\n"
"If not provided, the default timeout is "
f"{DEFAULT_RUNTIME_ENV_TIMEOUT_SECONDS} seconds. "
)
error_message = hint + error_message
await asyncio.sleep(
Expand Down

0 comments on commit e8dd54e

Please sign in to comment.