Announcement Announcement Module
Collapse
No announcement yet.
Job remains in JobState.RUNNING after Tasklet has completed Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Job remains in JobState.RUNNING after Tasklet has completed

    Hi Costin,

    I am successfully executing a Hadoop JobTasklet. I am using Quartz to kick-off the job every few minutes (the job takes about 30 seconds to complete). My problem is that I cannot kick off 2 or more jobs.

    My problem appears to be in the JobTasklet.execute() method. I have "wait for job" set to true so the code executes "job.waitForCompletion(false);". This immediately submits a job to the cluster because Job.state=DEFINE.

    However, when Quartz kicks off my second job, I see that "Job.state == RUNNING" and this causes execution to block until my previous job is marked as FINISHED (which happens immediately because JobClient.isComplete() determines that the job has completed). Execution then falls back to JobTasklet.execute() and RepeatStatus.FINISHED is returned.

    The bottom line is that my second job is never executed. Instead, it simply waits for my previous job to be marked as completed and then nothing else happens.

    Can you tell from my description if I am doing something incorrect?*
    Thanks in advance for any help you can offer.

    Rob.

  • #2
    Posting your configuration should help. It sounds like you need to make the tasklet and its associated job a prototype (in M2 only the job will most likely be required). You want on each invocation a new job to be executed but since the same job instance is used, on the second run the scheduler triggers the old job which is running so that's why it waits for it and then finishes.

    Does this make sense?

    Comment


    • #3
      Hi Costin,

      Thanks for your reply. I will let you know how I get on with your suggestion as soon as possible.

      Rob.

      Comment

      Working...
      X