OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

wsbpel message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [wsbpel] Issue - R26 - Default Compensation Order Conflict


This is an interesting situation. At the same time, this is another tale of non-isolated "scope" and "link" don't mix quite well. This complication rises from the difference in treatment of Control Dependency and Scope Completion Order.

Let me try to para-phrase Dieter's and Danny's proposals here to make sure we are on the same page:
  • Dieter's proposal: It changes on the "foward" work pattern. It basically makes certain scope as if "isolated in the sense of link/control dependency" in forward word execution when certain scope usage patterns occur.
  • Danny's proposal: It changes on the "backward" work pattern. It imposes a looser and higher granular compensation order. That is, the default compensation order is only imposed to peer scopes. (In fact, the default compensation order only matters to pear scopes. See Step #5 below)

Without any modification to existing BPEL specification, I expect the following behavior in Dieter's example:
  1. FH of scope "S0" is activated.
  2. It terminates any concurrent activities, including activity "E" and scope "S1".
  3. TH of scope "S1" compensates  scope "A"
  4. After termination is done,  the default compensation for FH of scope "S0" happens.
  5. The default compensation order is:
           In theory, "S2"=>"B"=>"A" (if we ever allowed compensate a child scope of an unfinished parent scope in future)
           In reality, "S2" (S1 is not completed)
  6.  S2 is compensated.

Note: even if the FH of scope "S0" is the non-default one and tries to do a sequence of <compensateScope target="S2"/> then <compensateScope target="S1"/>. The attempt to compensate scope "S1" will still be an no-op.

As of this moment, I tend to lean towards Danny's proposal. Because:
  • We do not allow compensate a child scope of an unfinished parent scope as of this moment. I doubt whether we would do it in future BPEL spec.
  • Danny's proposal is closer to what the current spec depicts today. That is less intrusive. Less chance to create new bugs or questionable corner cases.


Alex Yiu

Danny van der Rijn wrote:
I'm not sure I understand your case completely, but if I do, my understanding is that by the definition in 12.5.1, there exists a Peer Scope Dependency from S1 to S2.  I think the intention of "Rule 1" in that section was to say that this should cause compensation of S2 before S1, but, in fact, it does not.

My alternate suggestion would be to move the 3 definitions before "Rule 1" and to Modify the following the first sentence in the following paragraph

"Consider scopes A and B such that B has a control dependency on A. Assuming both A and B completed successfully and both must be compensated as part of default compensation behavior, the compensation handler of B MUST run to completion before the compensation handler of A is started. "

to say

Consider scopes A and B such that B has a *Peer Scope Dependency* on A. Assuming both A and B completed successfully and both must be compensated as part of default compensation behavior, the compensation handler of B MUST run to completion before the compensation handler of A is started."

ws-bpel issues list editor wrote:

This issue has been added to the wsbpel issue list with a status of "received". The status will be changed to "open" if a motion to open the issue is proposed and that motion is approved by the TC. A motion could also be proposed to close it without further consideration. Otherwise it will remain as "received".

The issues list is posted as a Technical Committee document to the OASIS WSBPEL TC pages on a regular basis. The current edition, as a TC document, is the most recent version of the document entitled in the "Issues" folder of the WSBPEL TC document list - the next posting as a TC document will include this issue. The list editor's working copy, which will normally include an issue when it is announced, is available at this constant URL.

Issue - R26 - Default Compensation Order Conflict

Status: received
Date added: 30 Oct 2006
Date submitted: 27 October 2006
Submitter: Dieter Koenig
Description: Consider the following hierarchy of scopes. In this example, none of the scopes is isolated, all scopes only have default fault handlers and default termination handlers, and scopes "A" and "B" have custom compensation handlers.
scope name="S0"
      scope name="S1"
         scope name="A"
            source link="fromAtoB"
      scope name="S2"
         scope name="B"
            target link="fromAtoB"
      activity name="E"
Assume a point in time where scopes "A" and "B" and "S2" have completed successfully, and scope "S1" and activity "E" are still running.

Further assume that activity "E" now throws a fault which is caught by the default fault handler of scope "S0".

  1. All running activities inside of scope "S0" are terminated, and the default termination handler of scope "S1" compensates scope "A".
  2. The default fault handler of scope "S0" then compensates scope "S2", which in turn compensates scope "B".

The observed compensation order "A then B" is caused by the sequence "first termination, then fault handling". OTOH, the required compensation order "B then A" implied by the control dependency of "B" on "A".

This is a contradiction.

Note that this situation cannot occur when the scope "S1" is an isolated scope. In this case, the link "fromAtoB" cannot leave the scope "S1" before it completes. In this case, scope "S1" always completes before scope "S2", and compensation of "A" cannot be caused by a termination handler before scope "B" is compensated.

Moreover, this conflict is irrelevant if scope "S1" OR scope "S2" only contain default compensation handlers, because in this case, no custom compensation logic can be executed in the wrong order.
Submitter's proposal: In order to avoid conflicts between the termination-handling / fault-handling sequence and the default compensation order, different strategies can be considered, for example, enforcing the absence of such conflicts during static analysis. A less restrictive approach is proposed here, which only affects the runtime behavior.

At the end of section 12.5.2, add the following paragraph:

"The default compensation order is initiated by default termination handlers and default fault handlers, and recursively carried forward by compensation handlers. The termination phase always precedes the fault handling phase (see section 12.6. Termination Handlers). This sequence must not create a conflict with the default compensation order of scopes that are in a control dependency relationship. If all of the following is true:
  1. scope "S2" has a direct peer-scope dependency on scope "S1"
  2. the scope-controlled set of activities of scope "S1" contains default termination handlers
  3. the scope-controlled set of activities of scope "S1" AND scope "S2" both contain at least one custom compensation handler then a WS-BPEL processor MUST execute these scopes as if "S2" had a control dependency on scope "S1".

Changes: 30 Oct 2006 - new issue

To comment on this issue (including whether it should be accepted), please follow-up to this announcement on the wsbpel@lists.oasis-open.org list (replying to this message should automatically send your message to that list), or ensure the subject line as you send it starts "Issue - R26 - [anything]" or is a reply to such a message. If you want to formally propose a resolution to an open issue, please start the subject line "Issue - R26 - Proposed resolution", without any Re: or similar.

To add a new issue, see the issues procedures document

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]