Skip to content

Commit c4d2414

Browse files
committed
Clarify the session ids in message headers.
From conversations with @minrk.
1 parent e899ef1 commit c4d2414

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

docs/messaging.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,26 @@ A message is defined by the following four-dictionary structure::
124124

125125
.. note::
126126

127-
A client session value, in message headers from a client, should be unique among
128-
all clients connected to a kernel and should be constant over the lifetime of
129-
the client. A kernel session value, in message headers from a kernel, should be
130-
generated on kernel startup or restart and should be constant for the lifetime
131-
of the kernel.
127+
The ``session`` id in a message header identifies a unique entity with state,
128+
such as a kernel process or client process.
129+
130+
A client session id, in message headers from a client, should be unique among
131+
all clients connected to a kernel. When a client reconnects to a kernel, it
132+
should use the same client session id in its message headers. When a client
133+
restarts, it should generate a new client session id.
134+
135+
A kernel session id, in message headers from a kernel, should identify a
136+
particular kernel process. If a kernel is restarted, the kernel session id
137+
should be regenerated.
138+
139+
The session id in a message header can be used to identify the sending entity.
140+
For example, if a client disconnects and reconnects to a kernel, and messages
141+
from the kernel have a different kernel session id than prior to the disconnect,
142+
the client should assume that the kernel was restarted.
132143

133144
.. versionchanged:: 5.0
134145

135-
``version`` key added to the header.
146+
``version`` key added to the header.
136147

137148
.. versionchanged:: 5.1
138149

0 commit comments

Comments
 (0)