Skip to content
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

Merged
merged 5 commits into from
Mar 31, 2020

Conversation

prognant
Copy link
Contributor

@prognant prognant commented Mar 24, 2020

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

@prognant prognant force-pushed the prognant/fix-RMI-socket-connection-timeout branch from 4224e31 to 8bb067d Compare March 24, 2020 21:52
@prognant prognant removed the wip label Mar 25, 2020
@@ -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);
Copy link
Contributor

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..

Copy link
Contributor Author

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.

Copy link
Contributor

@HantingZhang2 HantingZhang2 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Member

@truthbk truthbk left a 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"));
Copy link
Member

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.

@prognant prognant merged commit c2e7793 into master Mar 31, 2020
@prognant prognant deleted the prognant/fix-RMI-socket-connection-timeout branch March 31, 2020 18:55
prognant added a commit that referenced this pull request Apr 1, 2020
…connection-timeout"

This reverts commit c2e7793, reversing
changes made to c25dcc3.
prognant added a commit that referenced this pull request Apr 1, 2020
This reverts commit c2e7793, reversing
changes made to c25dcc3.
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