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
Make mc ping useful for startup checks #4584
Conversation
Add `--exit` parameter that will exit after first successful ping. This makes `mc ping` much more useful to detect when a server has started. ``` λ go build&&mc ping -x -e 10 myminio 1: http://127.0.0.1:9001:9001 min=1.37ms max=1.37ms average=1.37ms errors=0 roundtrip=1.37ms λ go build&&mc ping -x -e 10 myminio 1: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=1 roundtrip=2.05s 2: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=2 roundtrip=2.05s 3: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=3 roundtrip=2.03s 4: http://127.0.0.1:9001:9001 min=1.02s max=1.02s average=1.02s errors=0 roundtrip=1.02s λ go build&&mc ping -x -e 10 myminio 1: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=1 roundtrip=2.03s 2: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=2 roundtrip=2.05s 3: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=3 roundtrip=2.03s 4: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=4 roundtrip=2.04s 5: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=5 roundtrip=2.04s 6: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=6 roundtrip=2.04s 7: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=7 roundtrip=2.04s 8: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=8 roundtrip=2.02s 9: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=9 roundtrip=2.05s 10: http://127.0.0.1:9001:9001 min=0.00ms max=0.00ms average=0.00ms errors=10 roundtrip=2.04s λ _ ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I believe we have 'mc ready' for that
@vadmeste It can't really be used to wait for the cluster to be up (without some scripting magic)
|
This is actually a bug I think in the implementation, mc ping --exit-on-success is a good idea as well. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Add
--exit
parameter that will exit after first successful ping.This makes
mc ping
much more useful to detect when a server has started.How to test this PR?
Play around with your local server.
Types of changes