improve exponential backoff when connecting to the redis (#24150)

This commit is contained in:
ZhuSenlin 2022-04-25 16:10:24 +08:00 committed by GitHub
parent 306853b5b8
commit edf058d4f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -861,7 +861,9 @@ def wait_for_redis_to_start(redis_ip_address, redis_port, password=None):
) from connEx
# Wait a little bit.
time.sleep(delay)
delay *= 2
# Make sure the retry interval doesn't increase too large, which will
# affect the delivery time of the Ray cluster.
delay = 1000 if i >= 10 else delay * 2
else:
break
else:

View file

@ -181,7 +181,7 @@ REPORTER_UPDATE_INTERVAL_MS = env_integer("REPORTER_UPDATE_INTERVAL_MS", 2500)
# Number of attempts to ping the Redis server. See
# `services.py::wait_for_redis_to_start()` and
# `services.py::create_redis_client()`
START_REDIS_WAIT_RETRIES = env_integer("RAY_START_REDIS_WAIT_RETRIES", 16)
START_REDIS_WAIT_RETRIES = env_integer("RAY_START_REDIS_WAIT_RETRIES", 60)
LOGGER_FORMAT = "%(asctime)s\t%(levelname)s %(filename)s:%(lineno)s -- %(message)s"
LOGGER_FORMAT_HELP = f"The logging format. default='{LOGGER_FORMAT}'"