splunk/splunk-sdk-java — pull request #59 by pax95 (2013-12-16 19:13:43+00:00)
Title: Polished HttpService and fixed Receiver not closing InputStream when done.

The inputstream on the http response is not closed leaving a lot to open files on Linux in state CLOSE_WAIT.

Dump before patch -
mac:splunk prebenasmussen$ netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 localhost.8089 localhost.60058 ESTABLISHED
tcp4 714 0 localhost.60058 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60057 ESTABLISHED
tcp4 714 0 localhost.60057 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60056 ESTABLISHED
tcp4 714 0 localhost.60056 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60055 ESTABLISHED
tcp4 714 0 localhost.60055 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60054 ESTABLISHED
tcp4 714 0 localhost.60054 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60049 ESTABLISHED
tcp4 714 0 localhost.60049 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60039 ESTABLISHED
tcp4 714 0 localhost.60039 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60034 ESTABLISHED
tcp4 714 0 localhost.60034 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60028 ESTABLISHED
tcp4 714 0 localhost.60028 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60020 ESTABLISHED
tcp4 714 0 localhost.60020 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60015 ESTABLISHED
tcp4 714 0 localhost.60015 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60010 ESTABLISHED
tcp4 714 0 localhost.60010 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.60000 ESTABLISHED
tcp4 714 0 localhost.60000 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.59995 ESTABLISHED
tcp4 714 0 localhost.59995 localhost.8089 ESTABLISHED
tcp4 0 0 localhost.8089 localhost.59991 ESTABLISHED
tcp4 714 0 localhost.59991 localhost.8089 ESTABLISHED

With patch applied ->
mac:~ prebenasmussen$ netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 localhost.8089 localhost.51001 ESTABLISHED
tcp4 0 0 localhost.51001 localhost.8089 ESTABLISHED

I have only run part of the unittest's for verification of the patch !!