JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net

The open source
grid computing

 Home   About   Features   Download   Documentation   On Github   Forums 
May 15, 2021, 10:54:17 PM *
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: NPE calling getAllJobIds() when thread was interrupted  (Read 1264 times)


  • JPPF Council Member
  • *****
  • Posts: 138
NPE calling getAllJobIds() when thread was interrupted
« on: October 01, 2014, 09:42:43 PM »

Hey Laurent, I ran into an issue where a thread is interrupted while making a call to the getAllJobIds() method, and it throws an NPE.

Code: [Select]

At  connectionThread.get()..isConnecting() will throw a NPE because the close() method isn't guarded:

Code: [Select]
if (!connectionThread.get().isConnecting()) connectionThread.get().resume();

Code: [Select]
   * Close the connection to the remote MBean server.
   * @throws Exception if the connection could not be closed.

  public void close() throws Exception {
//CM: Need to guard this...
    if (connectionThread.get() != null) connectionThread.get().close();
    if ((jmxc != null) && isConnected()) jmxc.close();

Shouldn’t  close() use the same sync block as JMXConnectionWrapper.getAttribute()?
And JMXConnectionWrapper.getAttribute() should verify for null inside the sync block, not outside?

Code: [Select]
if (!isConnected() || ((connectionThread.get() != null) && connectionThread.get().isConnecting())) return null;
    synchronized(this) {

Thanks in advance



  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2268
    • JPPF Web site
Re: NPE calling getAllJobIds() when thread was interrupted
« Reply #1 on: October 02, 2014, 08:27:30 AM »

Hello CM,

I have registered this as bug JPPF-335 NPE in JMXConnectionWrapper.getAttribute(). I'm currently investigating how to reproduce and how to fix it. This may take some time, as the JMXConnectionWrapper code synchronization is pretty complex and prone to deadlocks if not done cautiously.  At the latest, a fix will be available for the next maintenance release v4.2.3, planned for mid-october.

Pages: [1]   Go Up
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at Fast, secure and Free Open Source software downloads