[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: installing compensation handlers for faulted scopes
issue: should a faulted scope be deemed successfully completed or not? currently, i beleive, a compensation handler is not installed for a faulted scope, irrespective of whether the fault is propagated-up or not. i realize, as Satish pointed to, there are issues with allowing the fault handler to attempt alternative normal completion. however, i would like to discuss this further to help convince ourselves that we are embarked on the right model for fault/compensation handling. (a) Normally, if a fault handler were to be able to handle the fault itself, that is, do corrective actions (both undo and redo), then the fault is not rethrown, and the forward action can proceed as normally intended. (b) On the other hand, if the fault handler is not able to handle the fault, perhaps it failed somewhere in its attempt to undo/redo, it rethrows the fault, and the normal execution is short-circuited. in the case of (a), it seems reasonable to install a compensation handler, since the fault was successfully handled, and forward progress can be made. If this is not the case, the problem is that every forward action has to check if the previous action(s) had successfully completed, which is non-trivial. In such a case, the developer is most-likely going to almost *always* rethrow* a fault in order to avoid having to check for every action if the previous one(s) had successfully completed. in the case of (b), it seems reasonable to *not* install a compensation handler, since the fault was not successfully handled, or rather the action did not completed successfully. summary: the fact whether a fault was rethrown by a fault handler may be used to decide whether to install a compensation handler or not. thanks.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]