JPPF Issue Tracker
Please log in to bookmark issues
CLOSED  Bug report JPPF-278  -  The DriverJobManagementMBean does not return current task count
Posted May 26, 2014 - updated Jul 09, 2014
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Bug report
  • Status
  • Assigned to
  • Progress
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     Daniel Widdis
  • Owned by
    Not owned by anyone
  • Category
    Management / Monitoring
  • Resolution
  • Priority
  • Reproducability
  • Severity
  • Targetted for
    icon_milestones.png JPPF 4.2
Issue description
The TaskBundle interface (and JPPFTaskBundle implementation) provide three methods for obtaining task count:
  • getTaskCount()
  • getInitialTaskCount()
  • getCurrentTaskCount()

When obtaining information about a job via the DriverJobManagementMBean, the JobInformation class is constructed using a TaskBundle but only the first two methods are used for populating its taskCount and initialTaskCount fields. (See line 84.) The comment for taskCount indicates that it should be the "Current Task Count", but the taskCount field is never decremented from the initialTaskCount. Only the TaskBundle's getCurrentTaskCount() method accurately reflects the current number of tasks remaining to be executed on the queue. It appears getTaskCount is mostly redundant with getInitialTaskCount.

Proposed resolution:
  • JobInformation constructor (line 84) can be modified to use the TaskBundle's getCurrentTaskCount() method rather than getTaskCount(). Alternately (or perhaps preferably),
  • The ServerJob's TaskCount should be decremented in (lines 78-82) where only the CurrentTaskCount presently is.

Steps to reproduce this issue
private String getQueueInfo() {
      StringBuilder q = new StringBuilder("Tasks in queue per job:");
      try {
        DriverJobManagementMBean proxy = jmx
        for (String jobUUID : proxy.getAllJobIds()) {
          q.append(" ").append(proxy.getJobInformation(jobUUID).getJobName())
      } catch (Exception e) {
      return q.toString();

Comment posted by
May 26, 09:34
The duality taskCount / currentTaskCount was introduced to try and keep some consistency when dealing with complex distribution scenarios: jobs distributed over multiple drivers and/or jobs distributed over multiple client channel. I know that's not working completely properly right now. Fixing the behavior will involve complex code changes, which I consider too risky for a maintenance release. Therefore I am changing the target to 4.2
Comment posted by
Jul 09, 07:34
fixed in in trunk revision 3248