]
Bartosz Baranowski updated WFLY-13043:
--------------------------------------
Affects Version/s: 22.0.1.Final
ManagedScheduledExecutorService keeps executing tasks after an
exception is thrown
-----------------------------------------------------------------------------------
Key: WFLY-13043
URL:
https://issues.redhat.com/browse/WFLY-13043
Project: WildFly
Issue Type: Bug
Components: Concurrency Utilities
Affects Versions: 18.0.1.Final, 22.0.1.Final
Reporter: Vinicius Kopcheski
Assignee: Eduardo Martins
Priority: Major
There is apparently a bug in the implementation of the ManagedScheduledExecutorService,
more specifically when using the inherited method of the ScheduledExecutorService,
[
scheduleWithFixedDelay|https://docs.oracle.com/javase/7/docs/api/java/uti...].
On its javadoc it is stated "If any execution of the task encounters an exception,
subsequent executions are suppressed.".
When [this
code|https://github.com/kopcheski/managed-scheduled-executor/blob/master/...]
is executed in any Wildfly from 10 to 18, the task is kept alive in the scheduler after an
exception is thrown and subsequent calls will happen anyway, contradicting the javadoc.
To add evidences of a misbehavior, I did two extra checks:
1. Running the exact same code in another JavaEE server (Payara);
2. Using plain JavaSE with the ScheduledExecutorService.
In both cases, after an exception being thrown, subsequent executions of it are - as the
javadoc states - suppressed.