Repository navigation
Conversation
|
Closing this. Our own client never opens client data flows on bidirectional streams. Every strategy uses unidirectional streams, and the only bidirectional stream it opens after the control stream is the flow discard. #229 already stops the broker from closing the connection on these streams; it refuses them with ERROR_FLOW_REFUSED, which is valid under MQoQ §9.20. Serving them would only matter for some other MQoQ client that uses them, and we don't have one. The branch and the TLA model in specs/tla/bidi-client-flow stay around if that changes. The review also raised a few things this branch would need before it could be merged: retained messages losing their flow target when queued, failed writes holding window slots until reconnect, and a stalled flow stream closing the whole connection. |
Part of #207. #229 refused client data flows on bidirectional streams with
ERROR_FLOW_REFUSED. MQoQ §9.20 allows them, and §9.1.2 keeps a flow's acks, PINGRESP and subscription deliveries on that flow. This serves them.What changes:
ERROR_INCOMPLETE_PACKET(§9.13.1).with_flow_discard_rxis now behindtransport-quic. Without it, a build of mqtt5 withbrokerbut notransport-quicfails clippy with dead code.The design was checked first with a TLA+ model in
specs/tla/bidi-client-flow. The README there has the results. The proposed rules hold over the full state space (3,478,866 states), and each alternative fails the invariant meant to catch it.Tests are in
quic_flow_streams.rs. Against main, the 8 new tests fail and the other 8 pass. I also broke the takeover check, the waiting of messages, the reply routing and the retained routing one at a time, and each was caught by its test. One rule has no failing test when broken: a late close from a superseded stream must not detach the flow. The broker stops that stream's reader when it supersedes it, so the late close only happens in a race a test can't set up.Not covered here, for the next parts of #207: