Skip to content

Conversation

@mbroadst
Copy link
Contributor

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.

@mbroadst
Copy link
Contributor Author

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! 😄)

@danielmewes
Copy link
Member

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()));
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh right right

@danielmewes
Copy link
Member

Left just two comments. The rest of it looks great!

@mbroadst mbroadst force-pushed the auto-reconnect-config branch 2 times, most recently from 9e140ca to f677d3e Compare April 25, 2016 16:50
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.
@danielmewes
Copy link
Member

Looks good, thanks @mbroadst .

@danielmewes danielmewes merged commit 332d6b6 into rethinkdb:next Apr 25, 2016
@danielmewes
Copy link
Member

I'm waiting for some small style improvements to go through review, and will cherry-pick this into v2.3.x then. It will ship with RethinkDB 2.3.2.

@mbroadst
Copy link
Contributor Author

@danielmewes fantastic, thanks!

@mbroadst mbroadst deleted the auto-reconnect-config branch April 25, 2016 22:24
danielmewes pushed a commit that referenced this pull request Apr 26, 2016
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.
@danielmewes
Copy link
Member

Cherry-picked into v2.3.x via c64cbe4, with small style improvements for the help output (for this and also other commands) in 057518d.

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.

3 participants