Repository navigation
Conversation
A fixed 8 KB SO_RCVBUF disabled TCP receive window auto-tuning and throttled large payload throughput, causing brokers to drop queued messages for slow subscribers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2234
Root cause
MqttClientTcpOptions.BufferSizedefaulted to8192and was always applied toSocket.ReceiveBufferSize/SendBufferSize. Setting a fixed smallSO_RCVBUFdisables TCP receive-window auto-tuning, so a 200 KB payload needs many round trips. Under sustained QoS 2 load the subscriber falls behind and Mosquitto (defaultmax_queued_messages 1000) silently drops queued messages (Outgoing messages are being dropped for client ...). The connection stays up and the client sees no error.Fix
BufferSizenow defaults to0= keep OS defaults. Explicit values > 0 are still applied as before.Verification
Reporter's repro (ooredm/mqtt-bug), Mosquitto 2.0.15 default config, 10,000 × 200 KB QoS 2, Windows, .NET 10:
master(8 KB buffer)BufferSize = 65536Test suite: 507/509 pass. The 2 failures (
Disconnect_Event_Contains_Exception,Invalid_Connect_Throws_Exception) fail identically onmasterin my environment (network/DNS dependent).