You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mqtt-kafka: per-worker offset maps in the subscribe factory are shared across clients #3167
MqttKafkaSubscribeFactory keeps maps that are shared by every client on an engine worker (highWaterMarks, offsetsPerPacketId; line numbers on develop at b1a53e9, approximate: ~177-178, ~212-213, ~1242). Each stream begin overwrites a high-water mark and can drop deferred offset commits that another client's stream is still waiting on.
This is suspected from reading the code and has not been run. The first step is a test with two clients on the same worker that shows one client's subscription changing another client's offset commits, or shows that the keys already separate clients.
MQTT 5.0 section 4.4 (message delivery retry) and section 4.3: acknowledgement state belongs to the session of one client; one client's activity must not change another client's delivery state.
Expected
If the interference is demonstrated: the offset and high-water bookkeeping is per client stream (or keyed by a value that separates clients), and one client's stream begin, reset or end never changes another client's pending offset commits.
If it cannot be demonstrated: stop, record the analysis on this issue, and close it as not planned; do not change the code.
Test plan (test-first)
Scripts through mqtt-kafka with two client ids on one binding on the same worker, QoS 1 and 2, where one client opens (or reopens) a subscription while the other has acknowledgements in flight. The first commit contains the scripts that demonstrate the defect; if none can, report that instead.
Notes
Found by a clause-by-clause audit of MQTT 3.1.1 and 5.0 conformance, by reading the code. Part of the MQTT conformance work under #512.
Activity