Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-24839

(7.4.z) WFLY-17807 - Invalid @Schedule expression results in infinite loop

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.4.12.CR1, 7.4.12.GA
    • None
    • EJB
    • None
    • False
    • None
    • False
    • Hide

      Boot the server with a single EJB:

       

      import javax.ejb.Schedule;
      import javax.ejb.Stateless;
      
      @Stateless
      public class ScheduleBug {
          @Schedule(persistent = false, hour = "*", minute = "*", second = "*/0")
          public void schedule() {
              System.out.println("tick");    
          }
      } 

       

      If the schedule is changed to

       

       

      @Schedule(persistent = false, hour = "*", minute = "*", second = "*/1") 

      everything works as expected. Negative increments ("*/-1") trigger the error as well.

       

       

      Show
      Boot the server with a single EJB:   import javax.ejb.Schedule; import javax.ejb.Stateless; @Stateless public class ScheduleBug { @Schedule(persistent = false , hour = "*" , minute = "*" , second = "*/0" ) public void schedule() { System .out.println( "tick" ); } }   If the schedule is changed to     @Schedule(persistent = false , hour = "*" , minute = "*" , second = "*/1" ) everything works as expected. Negative increments ("*/-1") trigger the error as well.    

      If a @Schedule expression of type Increment uses an increment of zero or less the server enters an infinite loop.

      The error is that in org.jboss.as.ejb3.timerservice.schedule.attribute.IntegerBasedExpression#processIncrement() the interval is not checked for validity.

      Verified on WildFly 23.0.2.Final and 26.1.3.Final. On WildFly 27.0.1.Final the imports have to be changed to jakarta.*.

              rhn-support-ivassile Ilia Vassilev
              rhn-support-ivassile Ilia Vassilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: