0 Replies Latest reply on Jan 27, 2020 7:35 AM by kopcheski

    ManagedScheduledExecutorService keeps executing tasks after an exception is thrown

    kopcheski

      Hello all,

       

      I'm apparently facing a bug in the implementation of the ManagedScheduledExecutorService, more specifically when using the inherited method of the ScheduledExecutorService (Java Platform SE 7 ), called scheduleAtFixedDelay. On its javadoc it is stated "If any execution of the task encounters an exception, subsequent executions are suppressed.".

       

      So if this code managed-scheduled-executor/MyExecutor.java at master · kopcheski/managed-scheduled-executor · GitHub  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.

       

      In order to convince myself that this is really an 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.

       

      Did I really spot a bug or I am misunderstading something?