Skip to content

Commit 1038884

Browse files
committed
rfc3: rename keepalive to control
Problem: keepalive messages may be confused with TCP keepalives, and are used for different purposes. Rename to control messages, and rename the two integer parameters to type and status, to reflect their usage in the broker.
1 parent 44ebc4d commit 1038884

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

spec_3.rst

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ framework. A Flux *instance* is a set of interconnected ``flux-broker`` tasks
6060
that together provide a shared communications substrate for distributed
6161
resource manager services. Services and utilities communicate by passing
6262
messages through the session brokers. There are four types of messages:
63-
events, requests, responses, and keepalives, which share a common structure
64-
described herein.
63+
events, requests, responses, and control messages, which share a common
64+
structure described herein.
6565

6666
Event messages are published such that they are available to subscribers
6767
throughout the instance. Events are published with a *topic string*
@@ -77,8 +77,9 @@ Responses are optional replies to requests. They follow the ZeroMQ
7777
ROUTER-DEALER message flow, which unwinds the source address route
7878
accumulated by the request, and uses them to select among peers at each hop.
7979

80-
Keepalives are control messages used by one peer to indicate to another
81-
peer that it is still alive when it is not otherwise communicating.
80+
Control messages are used for connection management and status communication
81+
between brokers. Unlike the other message types, they are only used between
82+
directly connected peers, never routed.
8283

8384

8485
Implementation
@@ -242,13 +243,13 @@ ABNF grammar [#f2]_
242243

243244
message = C:request *S:response
244245
/ S:event
245-
/ C:keepalive
246+
/ C:control
246247

247248
; Multi-part ZeroMQ messages
248249
C:request = [routing] topic [payload] PROTO
249250
S:response = [routing] topic [payload] PROTO
250251
S:event = [routing] topic [payload] PROTO
251-
C:keepalive = PROTO
252+
C:control = PROTO
252253

253254
; Route frame stack, ZeroMQ DEALER-ROUTER format
254255
routing = *identity delimiter
@@ -262,12 +263,12 @@ ABNF grammar [#f2]_
262263
payload = *OCTET ; payload ZeroMQ frame
263264

264265
; Protocol frame
265-
PROTO = request / response / event / keepalive
266+
PROTO = request / response / event / control
266267

267268
request = magic version %x01 flags userid rolemask nodeid matchtag
268269
response = magic version %x02 flags userid rolemask errnum matchtag
269270
event = magic version %x04 flags userid rolemask sequence unused
270-
keepalive = magic version %x08 flags userid rolemask errnum status
271+
control = magic version %x08 flags userid rolemask type status
271272

272273
; Constants
273274
magic = %x8E ; magic cookie
@@ -306,9 +307,15 @@ ABNF grammar [#f2]_
306307
; Monotonic sequence number in network byte order
307308
sequence = 4OCTET
308309

310+
; Control message type
311+
type = 4OCTET
312+
313+
; Control message status
314+
status = 4OCTET
315+
309316
; unused 4-byte field
310317
unused = %x00.00.00.00
311318

312319
.. [#f1] `RFC 7159: The JavaScript Object Notation (JSON) Data Interchange Format <https://www.rfc-editor.org/rfc/rfc7159.txt>`__, T. Bray, Google, Inc, March 2014.
313320
314-
.. [#f2] For convenience: the ``C:request``, ``S:response``, ``S:event``, and ``C:keepalive`` ABNF non-terminals refer to ZeroMQ messages, sent by client or server, and built from ordered ZeroMQ message parts (frames). Other non-terminals are built from concatenated ABNF terminals per usual. Thus it is meaningful for ``delimiter``, a message frame, to have zero length, since a zero-length message frame is valid ZMTP.
321+
.. [#f2] For convenience: the ``C:request``, ``S:response``, ``S:event``, and ``C:control`` ABNF non-terminals refer to ZeroMQ messages, sent by client or server, and built from ordered ZeroMQ message parts (frames). Other non-terminals are built from concatenated ABNF terminals per usual. Thus it is meaningful for ``delimiter``, a message frame, to have zero length, since a zero-length message frame is valid ZMTP.

0 commit comments

Comments
 (0)