From cb1c973156795160d8a55a292dd6600f3ebafaea Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Thu, 9 Nov 2023 13:24:57 -0600 Subject: [PATCH] Correct max retries value --- src/constants.jl | 3 +++ src/exceptions.jl | 6 ++---- src/runtime.jl | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/constants.jl b/src/constants.jl index 1e429e90..9001f1c3 100644 --- a/src/constants.jl +++ b/src/constants.jl @@ -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 diff --git a/src/exceptions.jl b/src/exceptions.jl index 944266e7..055b1bb5 100644 --- a/src/exceptions.jl +++ b/src/exceptions.jl @@ -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 diff --git a/src/runtime.jl b/src/runtime.jl index 5b67b02f..bf697e29 100644 --- a/src/runtime.jl +++ b/src/runtime.jl @@ -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))