Skip to content

PauseJobs or ResumeJob seems to work improperly. #761

Description

@KindElk

Version: 3.0.7.0

No checks on previous versions was performed.

Expected behavior

Job is executed. / MyJobClass.Execute is called.

Actual behavior

Job is not executed. / MyJobClass.Execute is not called.

Steps to reproduce

In words:
Create two (or more) any jobs in one identity group. Pause 'em via PauseJobs(GroupMatcher) as group. Unpause one of them, trigger it.

In code:

ISchedulerFactory sf = new StdSchedulerFactory();
IScheduler scheduler = await sf.GetScheduler();

string identityGroupName = "SomeGroup";
IJobDetail job1 = JobBuilder.Create<MyJobClass>()
	.WithIdentity(
		nameof( MyJobClass ) + Guid.NewGuid(),
		identityGroupName
	)
	.StoreDurably( true )
	.Build();
IJobDetail job2 = JobBuilder.Create<MyJobClass>()
	.WithIdentity(
		nameof( MyJobClass ) + Guid.NewGuid(),
		identityGroupName
	)
	.StoreDurably( true )
	.Build();

Scheduler.AddJob( job1,	replace: true ).Wait();
Scheduler.AddJob( job2,	replace: true ).Wait();

scheduler.Start().Wait();
scheduler.PauseJobs( GroupMatcher<JobKey>.GroupEquals( identityGroupName ) ).Wait();
scheduler.ResumeJob( job1.Key ).Wait();
scheduler.TriggerJob( job1.Key ).Wait();

Metadata

Metadata

Assignees

No one assigned

    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