Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't print Redis connection warning in ray.init(). #8475

Merged
merged 3 commits into from
May 18, 2020

Conversation

robertnishihara
Copy link
Collaborator

This removes the warning that always happens when starting Ray but is useless.

2020-05-17 11:18:58,520	INFO services.py:563 -- Failed to connect to the redis server, retrying.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

else:
break
if counter == num_retries:
else:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a little hesitant to use this syntax because it's not widely known and non-obvious what it does, but thought it was ok since the intended behavior should be clear from the error message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it. Very pythonic.

@@ -559,12 +556,10 @@ def wait_for_redis_to_start(redis_ip_address,
redis_client.client_list()
except redis.ConnectionError:
# Wait a little bit.
time.sleep(1)
logger.info("Failed to connect to the redis server, retrying.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The important change is just removing this logging statement.

@@ -559,12 +556,10 @@ def wait_for_redis_to_start(redis_ip_address,
redis_client.client_list()
except redis.ConnectionError:
# Wait a little bit.
time.sleep(1)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this time.sleep was probably making ray.init() a second slower than it needed to be.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/25997/
Test PASSed.

Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


Raises:
Exception: An exception is raised if we could not connect with Redis.
"""
redis_client = redis.StrictRedis(
host=redis_ip_address, port=redis_port, password=password)
# Wait for the Redis server to start.
counter = 0
while counter < num_retries:
num_retries = 5000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, is there a reason to not have num_retries as an arg anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reasoning was that we may want to change the meaning of num_retries, e.g., in this PR we are changing it from seconds to milliseconds, and that could break things for callers who are using that argument.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/25999/
Test FAILed.

time.sleep(1)
logger.info("Failed to connect to the redis server, retrying.")
counter += 1
time.sleep(0.001)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to just do exponential backoff here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason, just changed to use exponential backoff.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/26010/
Test PASSed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants