Spring Batch
  1. Spring Batch
  2. BATCH-1924

Restarting a stopped job in COMPLETED state prevents progress

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 2.1.9
    • Fix Version/s: 2.2.0, 2.2.0 - Sprint 21
    • Component/s: Core
    • Labels:
      None

      Description

      A job that is programatically stopped and restarted at a step prior to the step it was stopped in will not advance past the step it was previously stopped. Below is an example of a job with the issue:

      
      	<job id="restart.job6">
      		<step id="job6.step1" next="job6.step2">
      			<tasklet allow-start-if-complete="true" >
      				<chunk reader="customerFileReader" writer="xmlOutputWriter"
      					commit-interval="10" />
      			</tasklet>
      		</step>
      		<step id="job6.step2"  parent="formatFileStep" >
      			<next on="ES3" to="job6.step3" />
      			<stop on="ES4" restart="job6.step4" />
      			<listeners>
      				<listener ref="translator"/>
      			</listeners>
      		</step>
      		<step id="job6.step3" next="job6.step4"  parent="formatFileStep"/>
      		<step id="job6.step4"  parent="formatFileStep"/>
      	</job>
      

      The full export of this job can be found here: https://gist.github.com/4259471

        Activity

        Hide
        Dave Syer added a comment -

        This is actually only an issue if the stopped job has status < STOPPED (there is a unit test that verifies that it works for a FAILED step). See also the TODO in JobFlowExecutor - we probably need a new BatchStatus here (e.g. PENDING) - it wasn't possible to fix it in 2.1.* but 2.2 is a good opportunity.

        Show
        Dave Syer added a comment - This is actually only an issue if the stopped job has status < STOPPED (there is a unit test that verifies that it works for a FAILED step). See also the TODO in JobFlowExecutor - we probably need a new BatchStatus here (e.g. PENDING) - it wasn't possible to fix it in 2.1.* but 2.2 is a good opportunity.
        Hide
        Michael Minella added a comment -

        I just posted a comment on the JSR-352 public mailing list looking for clarification on the behavior of this configuration. I'll match whatever the outcome of that is to resolve this issue.

        http://java.net/projects/jbatch/lists/public/archive/2013-02/message/46

        Show
        Michael Minella added a comment - I just posted a comment on the JSR-352 public mailing list looking for clarification on the behavior of this configuration. I'll match whatever the outcome of that is to resolve this issue. http://java.net/projects/jbatch/lists/public/archive/2013-02/message/46
        Show
        Michael Minella added a comment - Pull request: https://github.com/SpringSource/spring-batch/pull/154

          People

          • Assignee:
            Michael Minella
            Reporter:
            Michael Minella
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.5d
              0.5d
              Remaining:
              Remaining Estimate - 0.5d
              0.5d
              Logged:
              Time Spent - Not Specified
              Not Specified