glassfish
  1. glassfish
  2. GLASSFISH-19870

Batch RI : Batch Exceptions : Restarting a running job execution starts a new job execution

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b79
    • Fix Version/s: 4.0_b84_RC1
    • Component/s: batch
    • Labels:
      None

      Description

      Tested with latest nightly : glassfish-4.0-b80-03_13_2013

      Steps:

      1) Restart a job execution which is currently running

      Issue --> Creates a new Job execution with FAILED status

      Not sure this is a bug or request as JobOperator.restart(executionid) doesn't have JobExecutionIsRunningException defined in RI ,but it should throw JobExecutionIsRunningException

        Issue Links

          Activity

          Hide
          ScottKurz added a comment -

          There are a couple aspects to this one.

          First, it's not clear whether you're saying that you're doing:

          // Restart, then do restart with the execution ID from the new restart, while first restart is still running

          long exec1Id = jo.start(...)
          long exec2Id = jo.restart(exec1Id, null);
          long exec3Id = jo.restart(exec2Id, null);

          OR:

          // Restart, then do restart with the execution ID from the new restart

          long exec1Id = jo.start(...)
          long exec2Id = jo.restart(exec1Id, null);
          long exec3Id = jo.restart(exec1Id, null);

          ----------

          The second case we've addressed in 1.0-b21. It will actually be treated via JobExecutionNotMostRecentException, since
          the 2nd time 'exec1Id' is passed, it is no longer the most recent.

          The first is not fixed and I don't want to promise yet it will be in b22.

          I agree JobExecutionIsRunningException would be a natural candidate ... but given that we hope to have frozen the API at this point, I'd suggest we can deal with this via JobRestartException.

          Show
          ScottKurz added a comment - There are a couple aspects to this one. First, it's not clear whether you're saying that you're doing: // Restart, then do restart with the execution ID from the new restart, while first restart is still running long exec1Id = jo.start(...) long exec2Id = jo.restart(exec1Id, null); long exec3Id = jo.restart(exec2Id, null); OR: // Restart, then do restart with the execution ID from the new restart long exec1Id = jo.start(...) long exec2Id = jo.restart(exec1Id, null); long exec3Id = jo.restart(exec1Id, null); ---------- The second case we've addressed in 1.0-b21. It will actually be treated via JobExecutionNotMostRecentException, since the 2nd time 'exec1Id' is passed, it is no longer the most recent. The first is not fixed and I don't want to promise yet it will be in b22. I agree JobExecutionIsRunningException would be a natural candidate ... but given that we hope to have frozen the API at this point, I'd suggest we can deal with this via JobRestartException.
          Hide
          arunkumar_s added a comment -

          Job execution has to be in a State(Failed/Stopped) to restart the execution. If a Job is in Started State, and trying to restart the same job execution then the user should get JobExecutionIsRunningException or JobRestartException

          Show
          arunkumar_s added a comment - Job execution has to be in a State(Failed/Stopped) to restart the execution. If a Job is in Started State, and trying to restart the same job execution then the user should get JobExecutionIsRunningException or JobRestartException
          Hide
          ScottKurz added a comment -

          Just doing another pass here. This is still a problem even in the latest code.

          Show
          ScottKurz added a comment - Just doing another pass here. This is still a problem even in the latest code.
          Hide
          ScottKurz added a comment -

          Fixed in jbatch 1.0-b24

          Show
          ScottKurz added a comment - Fixed in jbatch 1.0-b24

            People

            • Assignee:
              ScottKurz
              Reporter:
              arunkumar_s
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: