Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5496

Schedule Job Manager is creating more then one pending job for future.

    XMLWordPrintableJSON

Details

    Description

      Schedule Job Manager is creating more then one pending job for future. Issue is coming in sporadic manner when a transaction reach to its time out position.
      So schedule job is increasing with multiply by two or more after every execution and grabbing the whole application memory which may cause the out of memory error.
      Below is the algorithm structure of current implementation in version 12.04.

      1 returnList;
      2 pollDone = false;
      3 While pollDone is equal false
      4 Transaction Begin //Default time out 60 sec
      5 localPollList;
      6 update JOB_SANDBOX SET RUN_BY_INSTANCE_ID = 'ofbiz1', STATUS_ID = "SERVICE_QUEUED" WHERE RUN_TIME <= NOW() AND START_DATE_TIME = NULL AND CANCEL_DATE_TIME = NULL AND RUN_BY_INSTANCE_ID = NULL;
      7 result = SELECT RESULTS FROM JOB_SANDBOX WHERE RUN_BY_INSTANCE_ID = 'ofbiz1', STATUS_ID = "SERVICE_QUEUED";
      8 IF result is empty
      9 pollDone = true;
      10 ELSE
      11 For each result row
      12 Create the Persit Job Object and add to localPollList
      13 EndFor
      14 ENDIF
      15 Add the localPollList to returnList
      16 Transaction Commit
      17 EndWhile
      18 Return returnList

      Test Case Execution Step
      1. If transaction reach to its time out position so an exception will come on step 16 which will roll back step 6.
      But on step 15 return list has increased with list of Job object.
      2. In next iteration, If transaction does not reach to its time out position then on step 15 return list will again increase with list of same Job object.

      So return list will have duplicate Job object for one schedule job and each will create a pending Job for future base on recurrence info.

      Attachments

        1. JobManager_1104_1204.patch
          2 kB
          Ritu Raj Lakhera
        2. JobManager_1204_Generate_Issue.patch
          1 kB
          Ritu Raj Lakhera
        3. JobManager_1307_trunk.patch
          0.6 kB
          Ritu Raj Lakhera

        Activity

          People

            adrianc@hlmksw.com Adrian Crum
            rrlakhera Ritu Raj Lakhera
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: