JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report JPPF-537  -  Task is being submitted to a driver and canceled immediately afterwards, no cancellation effect is visible.
Posted Jun 19, 2018 - updated Jul 04, 2018
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
     ecx_q
  • Owned by
    Not owned by anyone
  • Category
    Client
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Reproducability
    Often
  • Severity
    Not determined
  • Targetted for
    icon_milestones.png JPPF 5.2.10
Issue description
We have issue related to task cancellation. Initially problem was noticed as job's client timeout sometimes did not work, but in the end it seems this is issue is just related to canceling job.

Steps to reproduce this issue
Issue is not easily reproducible - sometimes it is hard to capture this behavior, and sometimes it seems to happen on every run. For me it seems it is easiest to spot it with jppf driver and no nodes (so that job never really gets executed), but it can be reproduced also with both driver and node.

client.awaitWorkingConnectionPools(5000)
job = new JPPFJob("Job1")
job.setBlocking(false)
job.add(new JPPFAnnotatedTask(...))
client.submitJob(job)
job.cancel(true)
job.awaitResults()


When running such code, race condition between submitting job to driver and job cancel request makes awaitResult() wait for job to execute (what never happens when there is no node available) rather than returning immediately.

Please take a look at attached client and driver log files. Some debugging pointed out that probably job was canceled while being dispatched; client side cancellation flag was set, but job was still delivered for execution and cancel request was never sent to driver.

#1
Comment posted by
 ecx_q
Jun 19, 14:09
A file was uploaded. Client's log in case of cancelation failureicon_open_new.png
#2
Comment posted by
 ecx_q
Jun 19, 14:10
A file was uploaded. Client's log in case of cancelation successicon_open_new.png
#3
Comment posted by
 ecx_q
Jun 19, 14:11
A file was uploaded. Drivers's log in case of cancelation successicon_open_new.png
#4
Comment posted by
 ecx_q
Jun 19, 14:11
A file was uploaded. Drivers's log in case of cancelation failureicon_open_new.png
#5
Comment posted by
 ecx_q
Jun 19, 14:12
A file was uploaded. Drivers's log in case of cancelation successicon_open_new.png
#8
Comment posted by
 lolo4j
Jun 19, 18:40
Thanks for the report. From what I saw in the logs, this is happening when job.cancel() is called too soon after client.submitJob(job) (a few millisecons here).This is a scenario we clearly do not handle.
#9
Comment posted by
 lolo4j
Jun 20, 06:17
Fixed on master and branch 5.2. Published patch 01 for JPPF 5.2.9
#11
Comment posted by
 lolo4j
Jul 04, 05:52
Updated patch with latest commit c7f2689a2301eac9cfdd2a8eaf2955e8efacfa7e