Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CronTrigger.getTriggerBuilder() changes misfire instruction from "ignore misfire" to "smart" #505

Closed
wrwatson opened this issue Oct 14, 2019 · 2 comments
Assignees

Comments

@wrwatson
Copy link

wrwatson commented Oct 14, 2019

The method original.getTriggerBuilder() should return a trigger builder with all fields set the same as on original. However, the misfire instruction is not always set in the builder correctly.

The following code shows the issue:

    @Test
    public void testClone()
    {
        final CronTrigger original = TriggerBuilder.newTrigger()
                .withSchedule( CronScheduleBuilder.dailyAtHourAndMinute( 10, 0 )
                                                  .withMisfireHandlingInstructionIgnoreMisfires() )
                .build();
        final CronTrigger clone = original.getTriggerBuilder().build();

        System.out.println( "original=" + original.getMisfireInstruction() );
        System.out.println( "clone   =" + clone.getMisfireInstruction() );
    }

I would expect the value returned by getMisfireInstruction() to be the same for both triggers. However, clone has a the misfire strategy of 0 (Smart).

chrisdennis added a commit to chrisdennis/quartz that referenced this issue Oct 14, 2019
…ovide a sensible default and logging when seeing an invalid one
@chrisdennis chrisdennis self-assigned this Oct 14, 2019
jhouserizer added a commit that referenced this issue Oct 14, 2019
Fixes #505 : Cover all valid misfire policies, and provide a sensible…
@wrwatson
Copy link
Author

That was quick. Thankyou @jhouserizer and @chrisdennis

When is this likely to be published in a release?

@chrisdennis
Copy link
Contributor

Most likely some time this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants