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

Invalid @Schedule expression results in infinite loop

    XMLWordPrintable

Details

    • 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.    
    • ---
    • ---

    Description

      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.*.

      Attachments

        Issue Links

          Activity

            People

              cfang@redhat.com Cheng Fang
              s4p.com Thomas Reinhardt (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: