glassfish
  1. glassfish
  2. GLASSFISH-20100

Batch RI: Transition Elements not working other than COMPLETED exit status

    Details

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

      Description

      Tested with latest nightly.

      Steps:

      1) <fail on="COMPLETED" exit-status="EARLY COMPLETION"/> in Job XML for a <step> element.

      This works fine.Step which exits with COMPLETED exit status sets the JOB exit status as EARLY COMPLETION

      I tried with other possibilities given below, but these possibilities wont set the JOB exit status as expected.

      <fail on="FAILED" exit-status="EARLY FAIL"/>
      I have thrown an exception in a process execution,so the step fails with FAILED exit status. Step exit status get set as FAILED, but <fail> element didn't work.

      <fail on="STOPPED" exit-status="EARLY STOP"/>
      Used JobOperator.stop() to stop a process execution

      The same case applies to all other transition elements: end,next,stop

        Activity

        Hide
        ScottKurz added a comment -

        We have a few of these tests doing similar things in the TCK that have passed on every released version.

        Can you make the test app and/or logs available?

        Show
        ScottKurz added a comment - We have a few of these tests doing similar things in the TCK that have passed on every released version. Can you make the test app and/or logs available?
        Hide
        arunkumar_s added a comment -

        Couldn't able to attach here.

        Attached the deployable war file in https://www.dropbox.com/s/8yn5fcwtqv0dwfu/SampleBatchlets.war

        http://<Server>:<port>/SampleBatchlets/SimpleBatchletServlet

        Has three tests, One for Running a Job till it completes, Second Running a Job and Stopping in between , and third an Interrupted JOB(throwing some exceptions in Job process in between)

        Transition elements in Job XML.

        <fail on="COMPLETED" exit-status="EARLY COMPLETION"/>
        <fail on="STOPPED" exit-status="EARLY STOP"/>
        <fail on="FAILED" exit-status="EARLY FAIL"/>

        Show
        arunkumar_s added a comment - Couldn't able to attach here. Attached the deployable war file in https://www.dropbox.com/s/8yn5fcwtqv0dwfu/SampleBatchlets.war http://<Server>:<port>/SampleBatchlets/SimpleBatchletServlet Has three tests, One for Running a Job till it completes, Second Running a Job and Stopping in between , and third an Interrupted JOB(throwing some exceptions in Job process in between) Transition elements in Job XML. <fail on="COMPLETED" exit-status="EARLY COMPLETION"/> <fail on="STOPPED" exit-status="EARLY STOP"/> <fail on="FAILED" exit-status="EARLY FAIL"/>
        Hide
        ScottKurz added a comment -

        Now that I see what you're doing, I believe that we may indeed have had a gap here that we closed in more recent drops, which I think should go into the 4.0_b83 build.

        I need to come back to this and give it some more thought and maybe try your app. In the meantime, I would suggest that if you get the b83 build before I get back to this that you might give it a try.

        Show
        ScottKurz added a comment - Now that I see what you're doing, I believe that we may indeed have had a gap here that we closed in more recent drops, which I think should go into the 4.0_b83 build. I need to come back to this and give it some more thought and maybe try your app. In the meantime, I would suggest that if you get the b83 build before I get back to this that you might give it a try.
        Hide
        ScottKurz added a comment -

        Hi,

        This issue forced us to go back to the EG and rethink a couple of our implementation details. It looks like where we're ending up is that the
        normal completion and exception thrown paths will work as your test expects (once we deliver a fix).

        On the other hand, there'll be no transitions after a stop. JobOperator.stop() means stop, as soon as possible (roughly speaking).

        So these two exit statuses will be seen, but not the "EARLY STOP".

        <fail on="COMPLETED" exit-status="EARLY COMPLETION"/>
        <fail on="FAILED" exit-status="EARLY FAIL"/>

        After a stop, you could check for BatchStatus.STOPPED on job/step completion. You could also do something like use a StepListener and/or JobListener to query the current BatchStatus and set a special "is stopping" exit status on the JobContext.

        Note while the artifacts are still executing you'll see BatchStatus of STOPPING, not (yet) STOPPED.

        Will deliver this change with our next drop, probably today.

        Show
        ScottKurz added a comment - Hi, This issue forced us to go back to the EG and rethink a couple of our implementation details. It looks like where we're ending up is that the normal completion and exception thrown paths will work as your test expects (once we deliver a fix). On the other hand, there'll be no transitions after a stop. JobOperator.stop() means stop, as soon as possible (roughly speaking). So these two exit statuses will be seen, but not the "EARLY STOP". <fail on="COMPLETED" exit-status="EARLY COMPLETION"/> <fail on="FAILED" exit-status="EARLY FAIL"/> After a stop, you could check for BatchStatus.STOPPED on job/step completion. You could also do something like use a StepListener and/or JobListener to query the current BatchStatus and set a special "is stopping" exit status on the JobContext. Note while the artifacts are still executing you'll see BatchStatus of STOPPING, not (yet) STOPPED. Will deliver this change with our next drop, probably today.
        Hide
        ScottKurz added a comment -

        Resolved,

        But as I mentioned the STOPPED portion of the test needs to change since it isn't valid.

        Show
        ScottKurz added a comment - Resolved, But as I mentioned the STOPPED portion of the test needs to change since it isn't valid.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: