michaelklishin / quartz-mongodb

A MongoDB-based store for the Quartz scheduler. This fork strives to be as feature complete as possible. Originally by MuleSoft.
Other
249 stars 203 forks source link

Null trigger when job is deleted #12

Closed vladvoic closed 11 years ago

vladvoic commented 11 years ago

The function toTrigger(TriggerKey triggerKey, DBObject dbObject) throws JobPersistenceException

could return a null if the job was deleted but this is not handled correctly in the acquireNextTriggers. The case when trigger is null is not handled at all and this causes a null pointer exception which causes quartz to crash even though the issue is minor (only 1 trigger is in a weird state).

If you have some suggestions on how we should handle this I will implement it.

One easy approach is just to add a simple if and test for null, then log it and continue. A good approach would probably include removing the trigger or marking it a certain way.

Looking forward to your suggestions, Vlad.

michaelklishin commented 11 years ago

@vladvoic I assume the best thing we can do is to filter out nulls (not do anything with them). Feel free to submit a pull request :)

michaelklishin commented 11 years ago

1.2.0 is out with a fix