gohopper / jmxquery

Automatically exported from code.google.com/p/jmxquery
0 stars 0 forks source link

JMXQuery exits w/o closing connections #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. connect JConsole to the target host; open "Threads" tab
2. execute any valid check_jmx command; observe that a new thread was
created on the server
3. repeat #2 N times; observe that N new threads are created

The problem is that JMXQuery.main System.exit()'s *before* closing the
connection (rev 7). This means that underlying socket remains open and a
JMX Timeout thread created on the server-side remains alive for ~ 2
minutes, at which point it (hopefully) closes the connection before being
destroyed. 

The impact is this: the more frequent jmx_check invocations are, the more
extra threads will be live on the server, and the more connections will
remain open. Eventually a server may slow down or stop responding to (any!)
connection requests ;-

to fix: *always* attempt to close the connection before exiting.

Original issue reported on code.google.com by nikita.t...@gmail.com on 30 Sep 2009 at 4:52

GoogleCodeExporter commented 9 years ago
Please review the attached patch (should be applied from directory containing 
pom.xml):
-fix for Issue #8 - close connections before exiting
-update pom to use jdk source 1.5 (since the source code contains annotations 
that
won't compile at lower source versions)

-nikita

Original comment by nikita.t...@gmail.com on 30 Sep 2009 at 5:01

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for finding this

Original comment by snoop...@gmail.com on 16 Jan 2010 at 10:10