Next: Control message (SMObject/TCPIP/Control)
Up: Session Management
Previous: New OpenXM control servers
A client can send a signal to an engine by using the control channel
at any time. However, I/O operations are usually buffered,
which may cause troubles.
To reset an engine safely the following are required.
- 1.
- Any OX message must be a synchronized object in the sense of Java.
- 2.
- After restarting an engine, a request from a client
must correctly corresponds to the response from the engine.
SM_control_reset_connection is a stack machine command to
initiate a safe resetting of an engine.
The control server sends SIGUSR1 to the engine if it receives
SM_control_reset_connection from the client.
Under the OpenXM reset protocol, an engine and a client act as follows.
Client side
- 1.
- After sending SM_control_reset_connection to the
control server, the client enters the resetting state. It discards all OX messages from the engine until it receives OX_SYNC_BALL.
- 2.
- After receiving OX_SYNC_BALL the client sends
OX_SYNC_BALL to the engine and returns to the usual state.
Engine side
- 1.
- After receiving SIGUSR1 from the control server,
the engine enters the resetting state.
The engine sends OX_SYNC_BALL to the client.
The operation does not block because
the client is now in the resetting state.
- 2.
- The engine discards all OX messages from the engine until it
receives OX_SYNC_BALL. After receiving OX_SYNC_BALL
the engine returns to the usual state.
Figure 1 illustrates the flow of data.
OX_SYNC_BALL is a special OX message and
is used to mark the end of data remaining in the
I/O streams. After reading it, it is assured that each stream is empty
and that the subsequent request from a client correctly
corresponds to the response from the engine.
図 1:
OpenXM reset procedure
 |
Next: Control message (SMObject/TCPIP/Control)
Up: Session Management
Previous: New OpenXM control servers
Nobuki Takayama
平成14年3月2日