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?
It is possible that a job gets (falsely) re-enqueued during shutdow of a worker even though the job finished successfully.
Consider this example:
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 toSHUTDOWN_IMMEDIATE
. One solution would be to makeremoveInFlight
aware of any exceptions. What do you think?