commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ate Douma (JIRA)" <>
Subject [jira] [Resolved] (SCXML-205) finalStep gets called twice
Date Mon, 01 Sep 2014 21:19:21 GMT


Ate Douma resolved SCXML-205.
    Resolution: Fixed

Thanks Johannes for catching and reporting this!

The SCXMLSemantics.finalStep() indeed is incorrectly invoked twice, and not just from SCXMLExecutor.reset()
but also .eventStep().

As Woonsan already indicated, this is an regression since SCXML-197 where I moved the handling
of the finalStep into the SCXMLSemantics.firstStep() and .nextStep() but forgot to remove
them from SCXMLExecutor logic.

I've removed the old .finalStep() calls from SCXMLExecutor so it should now work again as

> finalStep gets called twice
> ---------------------------
>                 Key: SCXML-205
>                 URL:
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Johannes Wienke
>            Assignee: Ate Douma
>            Priority: Critical
> In the current trunk version, finalStep and hence all onexit actions of the final state
are called twice. The following scxml can be used to reproduce the problem.
> {code:xml}
> <scxml xmlns="" version="1.0" initial="Start" name="PublishEvent">
>   <final id="Start">
>     <onentry>
>       <log expr="'Entering state Start'"></log>
>     </onentry>
>     <onexit>
>       <log expr="'Leaving state Start'"></log>
>     </onexit>
>   </final>
> </scxml>
> {code}
> The onexit log message appears twice when running this example.
> I digged a bit in the source code and through a debugger I could find the cause for this
effect: The finalStep method of SCXMLSemanticsImpl gets called twice. One backtrace looks
like this:
> {noformat}
> SCXMLSemanticsImpl.finalStep(SCXMLExecutionContext) line: 215	
> SCXMLSemanticsImpl.firstStep(SCXMLExecutionContext) line: 132	
> SCXMLExecutor.reset() line: 331	
> SCXMLExecutor.go() line: 318	
> {noformat}
> and the seconds looks like this:
> {noformat}
> SCXMLSemanticsImpl.finalStep(SCXMLExecutionContext) line: 215	
> SCXMLExecutor.reset() line: 334	
> SCXMLExecutor.go() line: 318	
> {noformat}
> I am not sure about what should be the correct behavior, but to my mind, the second call
looks suspicious.

This message was sent by Atlassian JIRA

View raw message