Skip to content

RefireImmediately with JobChaining(The job referenced by the trigger does not exist) #663

Description

@Kuzukaze

I use JobChainingJobListener to connect several Jobs in Scheduler and then start first job.
So I add first Job with trigger like
scheduler.ScheduleJob(firstJob, SimpleTrigger);
and all other jobs I add like

jobListener.AddJobChainLink(previousJob.Key, currentJob.Key);
scheduler.AddJob(currentJob, true);

It works fine, after JobWasExecuted in jobListener jobs fire one by one with a chain.

Now I want to use RefireImmediately in my jobs like

catch (Exception ex)
{
	_logger.Error(ExecuteThrownExceptionMessage, nameof(context.JobDetail.JobType), ex.Message);
	var exc = new JobExecutionException(ex)
	{
		RefireImmediately = true
	};
	throw exc;
}

I made environment condition so my first job fails and reFires several times.
After some tries Execute works properly and JobWasExecuted in jobListener starts.
But when its time to fire next job in the chain we get "The job referenced by the trigger does not exist".
In RAMJobStore.cs

if (RetrieveJobInternal(newTrigger.JobKey) == null)
{
                    throw new JobPersistenceException("The job (" + newTrigger.JobKey +
                                                      ") referenced by the trigger does not exist.");
}

I do not quite understand how RefireImmediately works and why it has problem with the chaining next job.

Metadata

Metadata

Assignees

Labels

3.xCandidate for 3.x brancharea/triggersTrigger state management relatedbugConfirmed or reported bugs

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions