JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report JPPF-131  -  JPPF client does not release JMX thread upon connection failure
Posted Feb 27, 2013 - updated Dec 27, 2014
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Bug report
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Progress
       
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Client
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Reproducability
    Always
  • Severity
    Low
  • Targetted for
    icon_milestones.png JPPF 3.3
Issue description
In the case of a connectionFailed() event, such as defined in the ClientListener interface, the JMX connection thread held by the JPPF connection is not terminated. This leads to a thread leak in case of frequent disconnections from the driver, or when the client uses a large pool of connections to the driver.

A workaround is to close the JMX connection (and terminate the associated thread) from a ClientListener as in the following code:
JPPFClient client = new JPPFClient();
client.addClientListener(new ClientListener() {
  @Override
  public void newConnection(final ClientEvent event) {
  }
  @Override
  public void connectionFailed(final ClientEvent event) {
    AbstractJPPFClientConnection c = (AbstractJPPFClientConnection) event.getConnection();
    if (c.getJmxConnection() != null) {
      try {
        c.getJmxConnection().close();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
});
Steps to reproduce this issue
  • start a driver
  • start a client with the following config properties:
# discovery enabled (default)
jppf.discovery.enabled = true
# 10 connections
jppf.pool.size = 10
# connection failure notification after 5 seconds
reconnect.max.time = 5
  • start an admin console and perform a server restart multiple times, with shutdown delay = 100 ms and restart delay = 6000 ms (the restart delay must be > to the reconnect.max.time, otherwise no connection failure notification will be sent.
  • take a thread dump of the client application ==> you can see many threads "JMX connection ..." that were not terminated

#4
Comment posted by
 lolo4j
Feb 27, 21:50
Fixed. Changes committed to SVN:

The issue was updated with the following change(s):
  • This issue has been closed
  • The status has been updated, from Confirmed to Closed.
  • This issue's progression has been updated to 100 percent completed.
  • The resolution has been updated, from Not determined to RESOLVED.
  • Information about the user working on this issue has been changed, from lolo4j to Not being worked on.