Skip to content

Commit

Permalink
Correct max retries value
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Nov 9, 2023
1 parent 2431881 commit cb1c973
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/constants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ const NODE_IP_ADDRESS = "127.0.0.1"
const DEFAULT_SESSION_DIR = "/tmp/ray/session_latest"

const GCS_ADDRESS_FILE = "/tmp/ray/ray_current_cluster"

# Default `max_retries` option for non-actor tasks. Ray for Python defaults to 3.
const DEFAULT_TASK_MAX_RETRIES = 0
6 changes: 2 additions & 4 deletions src/exceptions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,10 @@ end
function Base.showerror(io::IO, ex::ObjectReconstructionFailedMaxAttemptsExceededError)
print(io, "$ObjectReconstructionFailedMaxAttemptsExceededError: ")
print_object_lost(io, ex.object_context)

# TODO: Update this message with more details on how to set `max_retries` once
# implemented: https://github.com/ray-project/ray/blob/ray-2.5.1/python/ray/exceptions.py#L593
print(io, m"""
The object cannot be reconstructed because the maximum number of task retries
has been exceeded. To prevent this error, set `max_retries` (default 3).
has been exceeded. To prevent this error, set `submit_task(; max_retries)`
(default $DEFAULT_TASK_MAX_RETRIES).
""")
return nothing
end
Expand Down
2 changes: 1 addition & 1 deletion src/runtime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ initialize_coreworker_driver(args...) = ray_jll.initialize_coreworker_driver(arg
function submit_task(f::Function, args::Tuple, kwargs::NamedTuple=NamedTuple();
runtime_env::Union{RuntimeEnv,Nothing}=nothing,
resources::Dict{String,Float64}=Dict("CPU" => 1.0),
max_retries::Integer=0)
max_retries::Integer=DEFAULT_TASK_MAX_RETRIES)
export_function!(FUNCTION_MANAGER[], f, get_job_id())
fd = ray_jll.function_descriptor(f)
task_args = serialize_args(flatten_args(args, kwargs))
Expand Down

0 comments on commit cb1c973

Please sign in to comment.