-
Notifications
You must be signed in to change notification settings - Fork 472
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
Add timeout when replica connect master #1172
Conversation
src/cluster/replication.cc
Outdated
@@ -236,18 +237,23 @@ void ReplicationThread::CallbacksStateMachine::Start() { | |||
handlers_.emplace_front(CallbacksStateMachine::WRITE, "auth write", authWriteCB); | |||
} | |||
|
|||
uint64_t last_connect_timestamp = 0, connect_timeout_ms = 3100; |
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.
If connect_timeout_ms
is not dynamically updated, it would be better to use constants?
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.
I had thought about using a constant before, but found that it wasn't used elsewhere, so I wrote it as a local variable to make it more intuitive.
Does CI fail because timeout is too short? @git-hulk |
Not sure, maybe connecting with timeout didn't work at all, you can have a test on your side. |
I found some problems with |
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. Sorry for these mistakes.
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.
Thanks all, merging... |
Fixed: #1170