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.
As an OX message is sent as a combination of several CMO data, a global exit without sending all may generate broken data.
An incorrect correspondence occurs if some data remain on the stream after restarting an 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
Engine side
Figure 1 illustrates the flow of data. OX_SYNC_BALL 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. We note that we don't have to associate OX_SYNC_BALL with any special action to be executed by the engine because it is assured that the engine is in the resetting state when it has received OX_SYNC_BALL.
Nobuki Takayama 2017-03-30