mirror of
https://github.com/wassname/ray.git
synced 2026-07-09 12:35:06 +08:00
Distinguish a bad --redis-password from any other Redis error (#11893)
This commit is contained in:
@@ -608,6 +608,17 @@ def wait_for_redis_to_start(redis_ip_address, redis_port, password=None):
|
||||
"Waiting for redis server at {}:{} to respond...".format(
|
||||
redis_ip_address, redis_port))
|
||||
redis_client.client_list()
|
||||
# If the Redis service is delayed getting set up for any reason, we may
|
||||
# get a redis.ConnectionError: Error 111 connecting to host:port.
|
||||
# Connection refused.
|
||||
# Unfortunately, redis.ConnectionError is also the base class of
|
||||
# redis.AuthenticationError. We *don't* want to obscure a
|
||||
# redis.AuthenticationError, because that indicates the user provided a
|
||||
# bad password. Thus a double except clause to ensure a
|
||||
# redis.AuthenticationError isn't trapped here.
|
||||
except redis.AuthenticationError as authEx:
|
||||
raise RuntimeError("Unable to connect to Redis at {}:{}.".format(
|
||||
redis_ip_address, redis_port)) from authEx
|
||||
except redis.ConnectionError:
|
||||
# Wait a little bit.
|
||||
time.sleep(delay)
|
||||
|
||||
Reference in New Issue
Block a user