Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-4427

Step status of the failed step by <fail> element becomes COMPLETED.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 8.2.0.Final
    • Batch
    • None
    • Hide

      wildfly:
      $ mvn clean test -P wildfly-managed (or -P wildly-remote)
      glassfish:
      $ glassfish4/bin/asadmin start-domain
      $ mvn clean test -P glassfish-remote

      Show
      wildfly: $ mvn clean test -P wildfly-managed (or -P wildly-remote) glassfish: $ glassfish4/bin/asadmin start-domain $ mvn clean test -P glassfish-remote

      Assuming the following job definition, if STEP1 returns "1" as the exit status, the job status becomes FAILED. But the step status is COMPLETED.

      job status: FAILED
      step: STEP1, step status: COMPLETED
      
      <job id="batch-job1" version="1.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd ">
      
      	<step id="STEP1">
      		<batchlet ref="TestBatchlet1" />
      		<next on="0" to="STEP2" />
      		<fail on="1" exit-status="FAILED_BY_EXIT_STATUS" />
      	</step>
      
      	<step id="STEP2">
      		<batchlet ref="TestBatchlet2" />
      	</step>
      </job>
      

      In this case, we can not restart the failed job from the failed step STEP1.
      This behavior is correct based on the description of 10.8 Restart Processing, 3. a. in JSR 352.
      But it is not expected result.

      10.8 Restart Processing

      3. Starting at the restart position, each execution element is re-examined to determine if it should re-execute:

      a. If the execution element is a COMPLETED step that specifies allow-restart-if- complete=false, then follow the transition to the next
      execution element based on the exit status for this step from the previous execution.

      On the other hand, If the STEP1 is failed by throwing an exception, both of the resulting job status and the step status are FAILED.

      job status: FAILED
      step: STEP1, step status: FAILED
      

      In this case, restarting the failed job is correctly executed, because the step status is FAILED.

      I think the step status of the failed step should be FAILED in both cases. But the section "8.6.2 Fail Element" of JSR352 says nothing about what step status value must be exposed after failed.

      This behavior is the same in GlassFish 4 and WildFly 8.2.

      So, I want to know what is the correct specification or intended behavior.

              cfang@redhat.com Cheng Fang
              tnishiga@redhat.com Takashi Nishigaya
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: