-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(auto_reconnect): allow runtime configuration of give_up_ms (v2) #5701
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
Conversation
|
sorry had to open a new PR because I seem to have lost the branch the original PR was opened on (most likely due to trying to solve issues with gitattributes! 😄) |
|
I'll take another look today. |
| node_reconnect_timeout_secs * 1000 > std::numeric_limits<int>::max()) { | ||
| throw std::runtime_error(strprintf( | ||
| "ERROR: cluster-reconnect-timeout is too large. Must be at most %d", | ||
| std::numeric_limits<int>::max())); |
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.
The maximum in the error message needs to take the * 1000 into account.
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 think the maximum in the error message is still consistently the actual maximum (numeric_limits::max === biggest supported integer right?). So the error message is correct, it was the checks that needed to ensure that:
a) the input number is indeed within that threshold
b) secondarily, since we intend to use it as ms the number multiplied by 1000 should still be within that range
Perhaps you think the error message should be more descriptive in the event that someone enters a number that is too big only once we are testing for conversion to ms?
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.
It should be:
throw std::runtime_error(strprintf(
"ERROR: cluster-reconnect-timeout is too large. Must be at most %d",
std::numeric_limits<int>::max() / 1000));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.
oh right right
|
Left just two comments. The rest of it looks great! |
9e140ca to
f677d3e
Compare
Currently the auto_reconnect instance used to reconnect lost nodes is hardcoded to give up reconnecting after 24 hours. This is not ideal in some scenarios where a user may want to remove a node from a cluster, without having to reset all other participating nodes in the cluster. This patch allows the user to change that value.
|
Looks good, thanks @mbroadst . |
|
I'm waiting for some small style improvements to go through review, and will cherry-pick this into |
|
@danielmewes fantastic, thanks! |
Currently the auto_reconnect instance used to reconnect lost nodes is hardcoded to give up reconnecting after 24 hours. This is not ideal in some scenarios where a user may want to remove a node from a cluster, without having to reset all other participating nodes in the cluster. This patch allows the user to change that value.
Currently the auto_reconnect instance used to reconnect lost nodes
is hardcoded to give up reconnecting after 24 hours. This is not
ideal in some scenarios where a user may want to remove a node from
a cluster, without having to reset all other participating nodes in
the cluster. This patch allows the user to change that value.