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

Retry randomUUID() to mitigate intermittent java NativeSeedGenerator failure #1705

Merged
merged 3 commits into from
Dec 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3214,7 +3214,17 @@ private InetSocketAddress connectHelper(ServerPortPlaceHolder serverInfo, int ti

setState(State.Connected);

clientConnectionId = UUID.randomUUID();
try {
clientConnectionId = UUID.randomUUID();
} catch (InternalError e) {
// Java's NativeSeedGenerator can sometimes fail on getSeedBytes(). Exact reason is unknown but high system
// load seems to contribute to likelihood. Retry once to mitigate.
if (connectionlogger.isLoggable(Level.FINER)) {
connectionlogger.finer(toString() + " Generating a random UUID has failed due to : " + e.getMessage() + "Retrying once.");
}
clientConnectionId = UUID.randomUUID();
lilgreenbird marked this conversation as resolved.
Show resolved Hide resolved
}

assert null != clientConnectionId;

Prelogin(serverInfo.getServerName(), serverInfo.getPortNumber());
Expand Down