Home : Object Orientation : Distributed Startup

Distributed Startup

Intent

Allow any number of mutually inter-dependant subsystems to initialise without causing deadlock or infinite recursion.

Motivation

Systems that consist of a number of comunicating processes always need to initialise in a controlled manner to ensure that each provider is available to each subscriber without causing deadlock or infinite recursion.

For example, the IO subsystem may be required by the error reporting subsystem to output errors, but if the IO subsystem fails to initialise, it needs to report an error.

Applicability

Use the distributed startup pattern when:

Structure

This pattern spans both the client and server sides of the network.

Class diagram

Participants

Collaborations

Sequence diagram

Each Concrete_Producer announces that the first phase of its startup is complete to the Startup_Coordinator. If the Startup_Coordinator is not present/able to handle the message, the Concrete_Producer exits after informing the Startup_Coordinator of the failure.

Each Concrete_Consumer announces that the first phase of its startup is complete to the Startup_Coordinator. If the Startup_Coordinator is not present/able to handle the message, the Concrete_Consumer exits after informing the Startup_Coordinator of the failure.

An arbitrary time later, the Startup_Coordinator informs the consumers that all producers are ready for subscription. This happens when all producers and consumers have indicated their readiness.

An arbitrary time later, the Startup_Coordinator informs all the consumers that its OK to subscribe to the producers.

Each consumer subscribes to the services it needs.

When a consumer has subscribed to all the services it needs, it informs the Startup_Coordinator.

When every consumer has subscribed to the services it needs, the startup first tells all produces to begin processing, then tells all consumers to begin processing.

NOTE: Since both the producers and consumers must contact the Startup_Coordinator to initialise the entire system, both the producers and consumers must subscribe to the Startup_Coordinator. This is the weak point in the pattern, and a strategy of a number of retries before failure should be used.

Consequences

The distributed startup pattern has the following consequences:

Implementation

Every producer and consumer must still connect to the Startup_Coordinator, which must decide when it is safe to start the system. A number of algorithms may be employed to start the system in a degraded or stand-by state.

Failure of a consumer to connect to a producer should be reported to the startup co-ordinator. Hence, if a user-interface or logging producer has started successfully, this can be used to report the error.

Related Patterns

The abstract factory pattern can be combined to spawn one producer per consumer.

Comments

Members have left 0 comments about this page:
Please Login or Register to comment on this page.

Resources
Tools
User
Last Updated Wednesday, 24-May-2006 22:44:26 BST