koraktor/steam-condenser — Issue #148: fd leak on linux systems
Author: schnix1980
Created: 2012-02-11 15:06:21+00:00
State: open

class "SteamSocket.java", method “receivePacket(int bufferLength)”

the selector "selector" gets opened and closed, if the destination server is alive and responding. But if the IOException gets thrown, the selector remains opened. This behavior causes a file descriptor leak on linux systems, because additional "pipes" and "anon_inodes" remain after each query in /proc/\/fd. The number of those file descriptors is limited to 1024 by default.

You could fix it by adding “selector.close();” to the “finally” section after the catch clause or something like that.

Regards