question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jobs is running and stays that forever but does not do anything

See original GitHub issue

Hi,

Quartz.Net version 3.0.2

With the following code I’m creating a job in the scheduler

            GetJobAndTriggerKey(job, out var jobKey, out var triggerKey);

            if (Scheduler.CheckExists(jobKey).Result) return;

            IJobDetail schedulerJob;

            if (jobDataMap != null)
            {
                schedulerJob = JobBuilder.Create(job.GetType())
                    .WithIdentity(jobKey)
                    .WithDescription(job.Info)
                    .RequestRecovery(true)
                    .SetJobData(jobDataMap)
                    .Build();
            }
            else
            {
                schedulerJob = JobBuilder.Create(job.GetType())
                    .WithIdentity(jobKey)
                    .WithDescription(job.Info)
                    .RequestRecovery(true)
                    .Build();
            }


            ITrigger schedulerTrigger = (ISimpleTrigger) TriggerBuilder.Create()
                .WithIdentity(triggerKey)
                .WithDescription(job.Info)
                .StartNow()
                .Build();

            _scheduler.ScheduleJob(schedulerJob, schedulerTrigger);

The jobs gets created but nothing happens, the code that is inside the job is not executed and the jobs stays in the running state forever.

I added extra logging and this is what QuartzNet is saying about that job

[Quartz.Core.QuartzSchedulerThread] - [Debug] Batch acquisition of 0 triggers  
[Quartz.Core.JobRunShell] - [Debug] Calling Execute on job SystemJob.0@Stockist pipeline  

To me it looks like that the job has no trigger, but if so how did it get in the running state and why does is stay there forever?

Do you have any idea what is going wrong overhere?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Khooshamcommented, Jan 29, 2018

Hello looks like i am getting the same issue. I have put logger in all my method to check if it goes inside… i have started the trigger in IIS Preload function that check for the new jobs in my db with status new. i have another scheduler/trigger that schedules the job where i have implemented myJobListener inside which i have the method JobTobeExecuted i have put a logger in that method it goes inside it but never to the Execute part.

if i start the scheduler thats check for my new jobs in db in application_start (global.asax) then it works fine. Note that it was working before maybe v 3.0.1 i have upgraded to v3.0.2 recently but did not revert back to check.

Can you let me know the write way to start the main scheduler that check for new job in my db Thank you !

0reactions
Khooshamcommented, Jan 30, 2018

I solved the issue in my case as well in the job listener method i was using Task.Completed which prevented the execute from happening. I have use Task.FromResult(true); and inside JobExecutionVetoed Method Task.FromResult(false);

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jobs stay at job queue forever
I am having a 9402 200 model with V3R2M0 and running an application there. In the past two weeks I experienced a problem...
Read more >
How Long is Too Long to Stay in the Same Job and 3 Huge ...
Long gone are the days where we finish school and then sign up to work for one company – in the same position...
Read more >
Pipeline keeps running forever if job needs other manual job
The pipeline should not stay in running state but show a success / fail state if the manual job is not being triggered....
Read more >
What are good jobs for someone who doesn't want to be ...
Musician ; Graphic Design Artist; Professional Freelancer/Gig Worker (See Upwork). Stuck doing the same thing? Not a ...
Read more >
Debugging kubernetes pods in Completed status forever ...
This issue got nothing to do with k8s cluster or setup. It's mostly with your Dockerfile. For the pod to be in running...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found