Download presentation
Presentation is loading. Please wait.
1
1 Ivan Lanese Computer Science Department University of Bologna Italy Error Handling in Service Oriented Computing Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi Zavattaro
2
Roadmap l Service Oriented Computing l SOCK l Error handling in SOCK –Dynamic installation of handlers –Interplay with request-response l The automotive case study l Conclusive remarks
3
Roadmap l Service Oriented Computing l SOCK l Error handling in SOCK –Dynamic installation of handlers –Interplay with request-response l The automotive case study l Conclusive remarks
4
Service Oriented Computing (SOC) l SOC is a paradigm to program distributed applications based on the composition of services l Services are software entities able to perform a specific task l A SOC application looks over the net for a set of suitable services and orchestrate them to reach its goal l Services are independent, eterogeneous and loosely- coupled l Services are looked for at runtime
5
Why SOC? l The same service can be used in different applications –Great code reusability l New services may be used in already existing applications –Always the best available service is used l The service composition can be changed to meet new requirements –Great adaptability l Services from different companies can be composed and interact –Useful for business processing
6
SOC challenges l We have to make eterogeneous services to interact –Interoperability problems - need for standardization –Security problems l How to describe services to allow for dynamic retrieval? –Service interface - not enough –Service goal - described using ontologies –Service behavior - allows to guarentee correctness of the composition (e.g., deadlock freedom)
7
Web services l A set of standards to realize the SOC idea l XML for data representation l SOAP for communication l WSDL for describing service interfaces –Based on one-way and request-response interaction patterns l UDDI for building service repositories l BPEL for orchestrating services –Graphical language to invoke and combine services
8
Roadmap l Service Oriented Computing l SOCK l Error handling in SOCK –Dynamic installation of handlers –Interplay with request-response l The automotive case study l Conclusive remarks
9
SOCK (Service Oriented Computing Kernel) l A process calculus for modelling service oriented systems l Strongly inspired by current technologies… –WSDL, BPEL –Implemented by Jolie l …but featuring a formal LTS semantics l SOCK explores service interactions –Based on WSDL interaction patterns
10
Why process calculi? l Formal methods are necessary to master the complexity of SOC –Different implementations of BPEL have different behaviours –Standards are only informally defined –Difficult to understand the interplay between different features l Process calculi allow to unequivocally specify the behaviour of the different mechanisms… –Clarify their semantics and their interactions –Drive the implementations l … and prove properties of the resulting system –Good behaviour guarenteed
11
SOCK layers l SOCK has a 3 layers architecture –Service behaviour layer: defines the basic behaviours of service instances –Service engine layer: deals with instantiation of services, sessions management, and state –Service system layer: describe whole networks of interacting services
12
Behaviour primitives o r @ z ( ~ y ; ~ x ) o ( ~ x ) o r ( ~ x ; ~ y ; P ) OutputInput One-way Request-response o @ z ( ~ y ) and assignment x: = e
13
Behaviour composition operators P ; Q  ? P : Q w h i l e d o P P j Q From sequential languages From concurrent calculi P i 2 W ² i ; P i
14
Booking the cheapest hotel
15
Service engine layer l Each running behaviour is completed by a state l Process definitions are specified, and instantiated on demand l A definition and all its instances are tagged by a correlation set ( P 1 ; S 1 ) P d [( P 1 ; S 1 ) j ::: j ( P n ; S n )] Y = c. P d [( P 1 ; S 1 ) j ::: j ( P n ; S n )]
16
More on correlation sets l A correlation set is a set of variables l Allow to manage concurrent sessions l When there are many possible receivers for a message… –A definition and an instance –Many instances of the same definition l …the most correlated one receives the message –Roughly a message (2,3) is received by (2,x) over (y,x) if both x and y are in the correlation set l If the definition receives the message a new instance is created
17
Service system layers l A service system is a parallel composition of located service engines Y 1 @l 1 jj ::: jj Y n @l n
18
l A three layered LTS semantics l The behaviour produces all the possible transitions l The service engine discards the transitions non compatible with state and correlation –The transition above is allowed in a state with y=5, not in a state with y=6 l The matching of synchronizing inputs and outputs is checked at the system level An idea about the semantics x: = y; P ¿ ([ 5 = y ] : [ 5 = x ]) ¡¡¡¡¡¡¡¡ ! P
19
Roadmap l Service Oriented Computing l SOCK l Error handling in SOCK –Dynamic installation of handlers –Interplay with request-response l The automotive case study l Conclusive remarks
20
Error handling l Safe composition of services requires to deal with faults –Scarce guarentees on components’ behaviour because of loose coupling –Unexpected events can happen l A fault is an abnormal situation that forbids the continuation of an activity –An activity that generates a fault is terminated l Faults should be managed so that the whole system can reach a consistent state l BPEL offers various mechanisms for error handling
21
Fault handling mechanisms l Based on the idea of long running transactions –ACID transactions impossible to obtain –Compensations are used to reach a consistent state l Faults terminate the current activity and trigger recovery activities specified by suitable handlers l Fault handler: executed as answer to a fault l Termination handler: executed to smoothly terminate a parallel activity l Compensation handler: executed to undo the effect of an already completed activity
22
What we propose? l A formal model for faults and compensations in SOC –Built on top of SOCK –Rigorous LTS semantics 1. Expressive high-level primitives –Mimicking but improving BPEL ones –Allowing for easy management of different kinds of faults 2. Dynamic installation of handlers –The fault handling code is always up-to-date 3. Faults do not spoil request-response communications –Automatic notification in case of server fault –The client always waits the reply from the server –Possible to recover from remote errors
23
Extending SOCK with faults and compensations l Code boxed into scopes {P} q –Provide a hierarchical structure –Define the boundaries of error handling activities l Primitives for: –Throwing faults: throw(f) –Installing handlers: inst(u,P) –Invoking compensations: comp(q) l A few other things
24
The scope hierarchy P H q P H q P H q P H q P H q At runtime the scopes contain handlers H
25
Throwing a fault q1q1 q2q2 (f,Q) Throw (f) (q 2,T 2 ) (q 1,T 1 )
26
Throwing a fault q1q1 q2q2 (f,Q) (q 2,T 2 ) (q 1,T 1 ) f Faults kill activities while propagating
27
Throwing a fault T1T1 q1q1 T2T2 q2q2 (f,Q) f Termination handlers of parallel activities are executed
28
Throwing a fault T1T1 q1q1 T2T2 q2q2 Q f When found, the fault handler is executed
29
More on fault propagation l Recovery activities cannot be killed by other faults –Error recovery activities are always completed l But termination overrides fault handling –Global errors more important than internal ones l After having been killed a scope smoothly terminates –Ongoing communications are terminated –No more faults can be thrown
30
Compensation handlers l Allow to undo the effect of an already completed activity –The fault handler of a purchase activity could ask to annul a previously done payment l Has to be explicitly programmed and invoked –Primitive comp(q) –Available only inside handlers –Only child activities can be compensated
31
Roadmap l Service Oriented Computing l SOCK l Error handling in SOCK –Dynamic installation of handlers –Interplay with request-response l The automotive case study l Conclusive remarks
32
Dynamic fault handling l In all the previously existing languages handlers are statically installed while programming –Java throw … catch … –BPEL handlers l Not always easy to write the desired compensation
33
Example l { throw(f) | while (i <100) if i%2=0 then P else Q, H} q l We want to compensate each completed execution of P and Q in the reverse order of execution l We need auxiliary variables to track the executions of P and Q –Complex and error-prone l Atomicity problem –Suppose P has been executed but the auxiliary variables have not been updated yet –If a fault occurs then the last execution of P is not compensated
34
Our solution l { throw(f) | while (i <100) if i%2=0 then P ; inst(f,P’;cH) else Q ; inst(f,Q’;cH), H 0 } q l P’ compensates P, Q’ compensates Q l The handlers are dynamically installed l cH (for current handler) allows to recover the previous handler for updating l inst is a special primitive that has higher priority than fault execution –No atomicity problem
35
Installing an handler Inst (f,Q) As soon as inst is enabled it is executed
36
Installing an handler (f,Q)
37
Compensation handlers l When an activity terminates the last defined termination handler becomes its compensation handler l Same handling for faults immediatly before activity termination and immediatly after activity termination
38
Installing compensation handlers q q’ Inst (q,Q)
39
Installing compensation handlers q (q,Q) Q terminates q’
40
Installing compensation handlers (q,Q) Handlers in q’ can compensate q using comp(q) q’
41
Roadmap l Service Oriented Computing l SOCK l Error handling in SOCK –Dynamic installation of handlers –Interplay with request-response l The automotive case study l Conclusive remarks
42
Fault handling and request-response l Request-response is a long lasting interaction l Faults on one side influence the other side l Two possibilities: –Faults on server side during the interaction –Faults on client side while waiting for the answer
43
Faults on server side l A client asks a payment to the bank, the bank fails l In ActiveBPEL the client receives a generic “missing- reply” exception l Our approach –The exact fault is notified to the client –The notification acts as a fault for the client –Suitable actions can be taken to manage the remote fault
44
Faults on client side l A client asks a payment to the bank, then fails before the answer l In BPEL the return message is discarded l Our approach –The return message is waited for –The handlers can be updated according to whether or not a non-faulty message is received –The remote activity can be compensated if necessary
45
Roadmap l Service Oriented Computing l SOCK l Error handling in SOCK –Dynamic installation of handlers –Interplay with request-response l The automotive case study l Conclusive remarks
46
Automotive case study l Case study of European project Sensoria l A car failure forces the car to stop l The car service system looks for –A garage to repair the car –A tow truck to take the car to the garage –A car rental to take the driver home l The suitability of the services is checked l The services are booked and paid via a bank
47
(Part of) the automotive case study in SOCK
48
Adding tow truck faults
49
Screenshot from JOLIE
50
Feedback from the case study l Easy to write the desired error handling policies l All the mechanisms are used l All unexpected behaviours catched
51
Roadmap l Service Oriented Computing l SOCK l Error handling in SOCK –Dynamic installation of handlers –Interplay with request-response l The automotive case study l Conclusive remarks
52
Conclusions l SOCK is a powerful framework for modelling SOC systems –Near to current technologies, but fully formalized –Good to experiment with error recovery strategies l Our proposal for error handling –Recovers BPEL approach based on fault, termination and compensation handlers –Adding new features l Dynamic installation of handlers –Allows to update the termination handler as the activity progresses l Errors do not spoil the request-response protocol –Either the fault or the normal answer is sent back –The answer can be used during error recovery
53
About Jolie l Jolie is a programming language for SOC based on SOCK l Extends the basic calculus with –Management of XML data –Support for different communication standards (SOAP, …) –…–… l Allows to program and orchestrate web service systems l Developed by Italian company ItalianaSoftware
54
Future work l Apply the dynamic approach to error-handling to other calculi –Other calculi for SOC (COWS, SSCC, CASPIS) –Basic calculi such as π-calculus [TGC08] l Study the relative expressive power of different approaches to error handling –Static vs dynamic handling installation –Hierarchical vs flat code structure
55
End of talk
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.