Skip to content

stomp: explicit receipts for sent messages

Stomp is using Websockets as the transport. Each command is a frame, so send() results in a SEND frame. Unless explicitly requested, there is no receipt whether the SEND frame was actually processed.

But DISCONNECT frames in stomp.py have a receipt, and it is waited for. Since Stomp is stream based, this receipt is also a cumulative acknowledgment that all the previous SEND frames have been at least received by the server. But then, in our cki-lib wrapper class, any disconnect() exceptions are swallowed in the connect() context manager, so whether this receipt is actually received is not checked. On top of that, there is some Clever distinction between received and processed frames in the docs for RECEIPT [1].

So, to make sure the SEND frames are correctly processed, explicitly request and wait for a receipt in send_message().

For now, keep swallowing exceptions on disconnect, as with the explicit SEND receipts above, there seems nothing to win with escalating any failures to the caller code. To get a better idea how often this happens, at least log the exception. In any case, this should be something to keep in mind when encountering future weirdness.

Part of redhat/centos-stream/tests/kernel/kernel-qe-tools#19 (closed)

[1] https://stomp.github.io/stomp-specification-1.2.html#RECEIPT

[skip coverage check]

Signed-off-by: Michael Hofmann mhofmann@redhat.com

Edited by Michael Hofmann

Merge request reports