gresrun / jesque

An implementation of Resque in Java.
http://gresrun.github.io/jesque
Apache License 2.0
628 stars 131 forks source link

successful job is re-enqueued during shutdown #138

Closed bp-FLN closed 6 years ago

bp-FLN commented 6 years ago

It is possible that a job gets (falsely) re-enqueued during shutdow of a worker even though the job finished successfully.

Consider this example:

worker.end(true)
worker.join(5000)

So if the job does not throw an InterruptedException and takes less than 5 seconds, removeInFlight will re-enqueue the job as the worker has been set to SHUTDOWN_IMMEDIATE. One solution would be to make removeInFlight aware of any exceptions. What do you think?

bp-FLN commented 6 years ago

thanks for merging #147