2 Replies Latest reply on Sep 6, 2006 3:36 PM by krmc

    Race condition in GpListener

    krmc

      I get the dump below in the console at undetermined times when running TestJBossESB. It appears to originate in GpListener.WaitForCmdOrSleep, but I think it's caused by the potential of GpListener.millisToWait to return a negative value. Suggest you change to this:

      long millisToWait()
      {
      long waitTime = 0;
      return (((waitTime = (Math.min(m_lNextReload,m_lEndTime) -
      System.currentTimeMillis())) < 0)?0:waitTime);
      } //________________________________

      I've been testing & haven't seen the problem yet.

      Keith

      C:\jboss-esb\product\docs\samples\TestJBossESB>java -cp C:\jboss-esb/product/bui
      ld/dist/lib/jbossesb-services.jar;C:\jboss-esb/product/build/dist/lib/jbossesb-c
      ommon.jar;C:\jboss-esb/product/build/dist/lib/jbossesb-listeners.jar;C:\JBoss\jb
      oss-4.0.4.GA/client/jbossall-client.jar;C:\JBoss\jboss-4.0.4.GA/client/log4j.jar
      ;C:\JBoss\jboss-4.0.4.GA/client/jboss-aspect-jdk50-client.jar;C:\JBoss\jboss-4.0
      .4.GA/client/jboss-aop-jdk50-client.jar;C:\JBoss\jboss-4.0.4.GA/client/jboss-ejb
      3-client.jar;. org.jboss.soa.esb.listeners.GpListener paramsDir/FileMoverConfigE
      xample.xml
      10:27:38,527 INFO ParamFileRepository:62 - Setting parameter repository root di
      r to [C:\jboss-esb\product\docs\samples\TestJBossESB\.].
      10:28:38,586 INFO GpListener:290 - Reloading parameters _______________________
      ______________________________
      10:29:38,605 INFO GpListener:290 - Reloading parameters _______________________
      ______________________________
      10:30:38,624 INFO GpListener:290 - Reloading parameters _______________________
      ______________________________
      Exception in thread "main" java.lang.IllegalArgumentException: timeout value is
      negative
      at java.lang.Thread.sleep(Native Method)
      at org.jboss.soa.esb.listeners.GpListener.waitForCmdOrSleep(GpListener.j
      ava:347)
      at org.jboss.soa.esb.listeners.GpListener.run(GpListener.java:282)
      at org.jboss.soa.esb.listeners.GpListener.main(GpListener.java:67)
      C:\jboss-esb\product\docs\samples\TestJBossESB>testjbossesb