JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report JPPF-465  -  Adaptive Grid demo is not working
Posted Jul 23, 2016 - updated Mar 21, 2019
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
    Samples
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Reproducability
    Always
  • Severity
    Normal
  • Targetted for
    icon_milestones.png JPPF 5.1.x
Issue description
When running the adaptive grid demo from the samples pack, the client application displays the following messages, then just hangs:
**** submitting jobs batch #1 *****
decreasing the number of server connections to 0
In the client log I can see the following exception:
2016-07-23 10:10:47,855 [DEBUG][apper-driver1-1-0001][org.jppf.client.balancer.ChannelWrapperRemote.run(233)]: 
java.lang.NullPointerException
  at org.jppf.io.IOHelper.sendData(IOHelper.java:285)
  at org.jppf.client.BaseJPPFClientConnection.sendTasks(BaseJPPFClientConnection.java:127)
  at org.jppf.client.JPPFClientConnectionImpl.sendTasks(JPPFClientConnectionImpl.java:35)
  at org.jppf.client.balancer.ChannelWrapperRemote$RemoteRunnable.run(ChannelWrapperRemote.java:215)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:745)
Steps to reproduce this issue
  • start a driver and a node
  • run the demo
  • ==> the demo hangs and its log shows the NPE

#3
Comment posted by
 lolo4j
Jul 23, 10:36
Observations:
  • the message "decreasing the number of server connections to 0" is printed when in the jobRemoved() method of the queue listener
  • decreasing to 0 should never happen, we should always have at least 1 connection
  • the NPE occurs while the client is sending the job to the server.
Analysis: the probable cause of the NPE is that the connection to the server was just closed (related to the 0 connections message). Thus, it seems that either the jobRemoved() notification is sent too soon, or we shouldn't assume that the job remains in the queue while it is being executed. In fact, looking at the code, I can see that when the number of tasks to send to the server, computed by the client-side load-balancer, equals or exceeds the number of unexecuted tasks in the job, then the job is removed from the queue. It may be put back in later on, for instance if the server connection fails and the job is consequently resubmitted.

Conclusion: it seems the queue listener is not suitable for the purpose of the demo and should be replaced with another mechanism. The demo code and documentation shall be updated accordingly.
#4
Comment posted by
 lolo4j
Jul 23, 13:03
Fixed in: