diff --git a/docs/MxAccessWorkerInstanceDesign.md b/docs/MxAccessWorkerInstanceDesign.md index d53543b9..42d79632 100644 --- a/docs/MxAccessWorkerInstanceDesign.md +++ b/docs/MxAccessWorkerInstanceDesign.md @@ -1025,6 +1025,16 @@ Graceful shutdown sequence: If shutdown wedges, the gateway kills the process. The worker should be written so process kill does not corrupt other sessions. +**Residual events are discarded (v1 behavior).** The worker has no final event +flush. The event-drain loop runs concurrently with the shutdown steps above, so +events that it frames before the message loop exits are delivered, but the loop +is cancelled as soon as the shutdown ack has been written and the message loop +returns. Events still queued in the worker's event queue at that point, and any +event raised after the ack, are discarded with the session; they are not framed +and not sent to the gateway. A caller that needs the last events of a session +must drain them (`DrainEvents`, or consume the event stream) before requesting +shutdown. + ### Ending the pipe read (net48) Step 8 above cannot be done by cancellation. On .NET Framework 4.8