1 Reply Latest reply on May 27, 2008 4:38 PM by Alejandro Guizar

    Possible live lock with jobExecutor

    Pascal Verdage Newbie

      Using the jobExecutor autostart functionality in a test suite, I created a live lock. It happened in short tests.
      Guillaume spotted it, then I reproduced it in a test (in JobExecutorTest) and fixed it.
      The code to create the lock was: (it no longer happens cause it's fixed)


      The lock was due to a late initialization of isActive attribute: it was set to true in the run method, which is lauched in the new thread, after a system context switching.
      If you add the line
      isActive = true;

      at the beginning of the run method in DispatcherThread, you can reproduce the bug.

      The problem is, if you add the line and create the bug, there can be (not always) a live lock in the tests because the DispatcherThread is not stopped: the stop() method is called before the run() method. I added a JDK timer to stop the thread, but it doesn't work.

      I will look at it on Monday, but I prefered to alert you if anything occurs before.