Reliable distributed Eiffel components

advertisement
Reliable distributed Eiffel components
Cordie; 4-5 July 2006; page 1
Eiffel
Cordie-06
Distribution and concurrency
This presentation
Rest of conference
Commercial requirements
Rigorous analysis
Fault tolerant middleware
Language bias
Eiflex
Channel Library +
mgmnt. App
SCOOP
RECOOP
MP Eiffel
Can they come together?
Reliable distributed Eiffel components
Cordie; 4-5 July 2006; page 2
Middleware Requirements
Target market
Enterprise integration,
Process enactment
Asynch dominant
Intermediate state
Interactions
RPC
Publish / Subscribe
Sequenced messaging
Synch and Asynch with agent callback
Where current value matters
Each and every message important
operations
CHANNEL_PROXY
topics
CHANNEL_SERVER
te
sis
per
nt
messages
pe
rsi
ste
nt
messages
CHANNEL_PROXY
replica
Fault Tolerance of Distributed Components
Channel transactions
Persistent items
Replica processes
Reliable distributed Eiffel components
Cordie; 4-5 July 2006; page 3
Demo highlights
Registry / Name service - bootstrap
Server processes – relatively static – Node Manager
Thread (SCOOP Processor) Factories
Channel (SCOOP separate object) Factories
Power of pub / sub interface – no polling.
Persistent state – currently Eiffel like text
Recovery after resurrection (or find replica)
Reflection of Channel offerings
Reliable distributed Eiffel components
Cordie; 4-5 July 2006; page 4
Producer / Consumer Model
Each consumer thread has a queue of actions:
Proxy CHANNEL_COMMAND_THREAD
(SCOOP Processor) main actions

Request to perform operation

Response from operation

Subscribe to topic

Topic current value

TXN topic updates

Fire timer

Sequenced message
Server







Other consumer threads:
Timer scheduler
– Relative, cyclic and absolute channel timers
– Inline timers (for infrastructure only)
Diagnostic logger
– Receives logging info to write “out of mainline processing”
Tunnel writers
– All writes done with blocking sockets – simplicity
Producer threads:
Tunnel readers
– All reads done with blocking sockets – simplicity
Connectors
– Keep retrying on breaks, then delivers stream to reader and
writer.
Timer scheduler - also a producer
Reliable distributed Eiffel components
Cordie; 4-5 July 2006; page 5
Deadlock Avoidance
Main criticism of original SCOOP – deadlock on callback
Eiflex style is mostly asynch – but synch possible, and need to avoid
deadlock. Approach:
1. “Logical threads” allows callbacks. Equivalent to lock
passing? except some other actions possible
2. Exceptions and delayed application retry for conflicts.
command received
idle
synchronous request sent
busy
command completed
response received
waiting
correct sequence call received
response sent
1. GUI synch call arrives for Ch1
3. Ch1 synch calls Ch3.Thread1 waits
2. Thread1 idle so call
delivered to Ch1
5. Thread2 idle so call delivered to Ch3
9. Ch3 returns to Ch1
10. Ch1 returns to GUI.
Ch1
Ch3
7. synch call arrives.
Thread1 waiting but this
call is in sequence so
passed to Ch2
6. Ch3 synch calls Ch2
Ch2
11.Thread is now idle so
can pass call to Ch2
8. Ch2 returns to Ch3
Thread1
4. synch call arrives for Ch2,
but Thread1 waiting and
call not in sequence so held in queue
Thread2
Reliable distributed Eiffel components
Cordie; 4-5 July 2006; page 6
Adapters
Integration implies talking to “alien” systems. Small
portfolio of adapters from previous deployments, mostly
still at phase 2 type system:
–
–
–
–
–
–
–
Liffe protocol
ITC messages
FIX protocol
CLICK protocol
HTTP reflection service
TCP, UDP and File strings
Not done SOAP yet, but probably should
Reliable distributed Eiffel components
Cordie; 4-5 July 2006; page 7
Eiflex past and present
Eiflex object interchange evolution
Phase 0 – 1998 Pilot for Chicago Board of Trade
– Eiffel objects
– CORBA RPC values only, no deltas
– Single server process
Phase 1 – 1999 Production support for floor trading
– Topics pub/sub
– Neutral data types
– Deltas for topics and persistence
– Types disliked by (most) programmers
– dml like wiring of low level components
– CORBA as distribution carrier
– Multi process (120), Single threaded
Phase 2 – 2003 Production support for electronic trading
– Multi threaded channel library
– Dropped CORBA – bespoke distribution
– Retained Neutral data types
– Multi process (120), Multi threaded
Phase 3 – 2006 Retirement “hobby” – looking for client
– Eiffel objects and delta classes
– Fallback to neutral if class doesn’t exist
– “Storers” intercept for special case int/externalization. Eg
channel servers, cyclic references, meta types.
– Move messaging from adapters to core
Download