Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9586

Persistent EJB timers should resume only once if missed multiple times

    Details

      Description

      Timers which are persistent need to resume if the timeout is missed, i.e. if the server was down.
      The EJB specification say by ยง13.2:
      "In the event of a container crash or container shutdown, the timeout callback method for a persistent timer that has not been cancelled will be invoked on a new JVM when the container is restarted or on another JVM instance across which the container is distributed. This rule applies to both programmatically or automatically created persistent timers."

      The understanding is not clear and can be

      • resume ALL missed timeouts
      • resume but fire the timer only once

      As Wildfly prevent from having the same timeout running concurrent a server start will have the effect that multiple timeouts are fired (assume you have a timer scheduled for every second and the server is down for minutes) but only the first (or a couple) will efectively executed all other will 'only' burden the server and log warn/error messages.

      The effect for the server start is a slower startup, long list of log messages and no real benefit!

      If the spec is really unclear here a configuration flag should be added to control that behaviour (like done for ejb invocation in-vm calls - byReference/byValue)
      The current behaviour should be the default but a boolean attribute should allow to fire the timer only once and set the next timeout according to the schedule (recurring or calendar) in the future.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swd847 Stuart Douglas
                Reporter:
                wdfink Wolf-Dieter Fink
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: