fix: Makes sure the ReadThread continues running after an exception. (#144)

This commit is contained in:
bgrozev 2018-07-13 14:42:04 -05:00 committed by GitHub
parent 38e7b9226d
commit 4aef25b91f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1027,8 +1027,13 @@ public abstract class AbstractTcpListener
} }
} }
} }
catch (IOException | IllegalStateException e) catch (Exception e)
{ {
// The ReadThread should continue running no matter what
// exceptions occur in the code above (we've observed exceptions
// due to failures to allocate resources) because otherwise
// the #newChannels list is never pruned leading to a leak of
// sockets.
logger.info( logger.info(
"Failed to handle TCP socket " "Failed to handle TCP socket "
+ channel.channel.socket() + ": " + e.getMessage()); + channel.channel.socket() + ": " + e.getMessage());