[jboss-jira] [JBoss JIRA] (WFLY-13043) ManagedScheduledExecutorService keeps executing tasks after an exception is thrown
Vinicius Kopcheski (Jira)
issues at jboss.org
Thu Jan 30 15:14:29 EST 2020
Vinicius Kopcheski created WFLY-13043:
-----------------------------------------
Summary: 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
Reporter: Vinicius Kopcheski
Assignee: Eduardo Martins
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/util/concurrent/ScheduledExecutorService.html#scheduleAtFixedRate(java.lang.Runnable,%20long,%20long,%20java.util.concurrent.TimeUnit)]. 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/src/main/java/org/example/MyExecutor.java] 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.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list