-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix rmi socket connection timeout #285
Conversation
4224e31
to
8bb067d
Compare
@@ -27,6 +29,8 @@ | |||
private static final String KEY_STORE_PASSWORD_KEY = "key_store_password"; | |||
private static final String DEFAULT_RMI_RESPONSE_TIMEOUT = | |||
"15000"; // Match the collection period default | |||
// Match the default RMI connection timeout value | |||
private static final Integer DEFAULT_RMI_CONNECTION_TIMEOUT = Integer.valueOf(0); |
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.
Hi @prognant, I'm not sure if we should put 0 here as the default since 0 means infinite and the purpose of this PR is to put a non-zero default value for the socket timeout..
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.
@HantingZhang2 I agree, I'm always a little bit concerned about changing a default value, in this cas we may use something like 15sec (as initially suggested) or 30sec it should not impact existing deployment.
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.
Looks good to me! 👍
rmiConnectionTimeout = (Integer) connectionParams.get("rmi_connection_timeout"); | ||
} catch (final ClassCastException e) { | ||
rmiConnectionTimeout = | ||
Integer.parseInt((String) connectionParams.get("rmi_connection_timeout")); |
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.
note to self: this would not trigger a java.lang.NumberFormatException
when connectionParams.get("rmi_connection_timeout")
is null, because the cast of (Integer) null
is valid. So we're good.
Based on #283 & #282
It aims to provide piece of resolution for #279
It allows to set a RMI connection timeout on a per-instance basis, using the configuration parameter
rmi_connection_timeout
(in milliseconds).