jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
489 stars 115 forks source link

Quartz RunningJobCache works wrong in some cache implementation #3454

Closed Gavrilov-Ivan closed 2 weeks ago

Gavrilov-Ivan commented 3 weeks ago

Environment

Jmix version: 2.3

Bug Description

https://forum.jmix.io/t/joblistener-quartz-jobexecutionlistener-threw-exception/5130

There are two issues in this RunningJobsCache that occur with some cache implementation like Hazelcast or Redis (but works with default one):

Additional suggested changes:

Steps To Reproduce

Steps to reproduce the behavior.

  1. Enable Hazelcast as a cache provider
  2. Create job with notable execution time.
  3. Check job execution

Current Behavior

Runtime exception with serialization issue. UI not reflecting state changes (visible after fix of serialization issue)

Expected Behavior

Cache should work properly with different cache implementations.

Gavrilov-Ivan commented 2 weeks ago

Changes:

For QA:

SergeiAksenov2 commented 2 weeks ago

Tested on: Jmix version: 2.3.999-SNAPSHOT Jmix Studio plugin version: 2.3.SNAPSHOT6580-241 IntelliJ version: IntelliJ IDEA 2024.1.4 (Community Edition)

Two class jobs, with the @DisallowConcurrentExecution annotation and without the one. Two triggers for each jobs. Make crossing triggers. There is no Paused status in the automatic mode of jobs - Ok.

If two triggers are identical in start/end for the job with @DisallowConcurrentExecution, they run the job one after the other, there is doubling the job time.