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

Improper connection closing. CPU usage 100% #9

Closed
sealedtx opened this issue May 11, 2020 · 0 comments · Fixed by #10
Closed

Improper connection closing. CPU usage 100% #9

sealedtx opened this issue May 11, 2020 · 0 comments · Fixed by #10

Comments

@sealedtx
Copy link
Contributor

sealedtx commented May 11, 2020

Improper closing by client causes infinite handling exception SocketException inside IOException catch block produced by reader.readline():

try {
line = reader.readLine();
} catch(SocketTimeoutException ex) {
// Check if the socket has timed out
if(!dataConnections.isEmpty() && (System.currentTimeMillis() - lastUpdate) >= timeout) {
Utils.closeQuietly(this);
}
return;
} catch(IOException ex) {
return;
}

Due to simple return the thread ConnectionThread hangs forever and consume a lot of CPU because of handling exceptions and filling stacktraces.

@sealedtx sealedtx changed the title Connection not closing. CPU usage 100% Improper connection closing. CPU usage 100% May 11, 2020
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 a pull request may close this issue.

1 participant