net/tcp/tcp_send: Remove work_available check when updating retransmit timer - #19589
Open
zhekunren wants to merge 1 commit into
Open
net/tcp/tcp_send: Remove work_available check when updating retransmit timer#19589zhekunren wants to merge 1 commit into
zhekunren wants to merge 1 commit into
Conversation
zhekunren
force-pushed
the
fix/tcp-retransmit-timer-remove-work-available
branch
from
July 31, 2026 09:31
2606ae9 to
c127429
Compare
Contributor
|
smart fix : ) |
jerpelea
requested changes
Jul 31, 2026
jerpelea
left a comment
Contributor
There was a problem hiding this comment.
please rename the commit tile to
net/tcp/tcp_send: Remove work_available check when updating retransmit timer
|
xiaoxiang781216
approved these changes
Jul 31, 2026
…t timer The condition work_available(&conn->work) && tx_unacked != 0 prevented tcp_update_retrantimer from being called when the work queue was still busy, leaving conn->timer stale or zero on subsequent sends. This caused the RTT estimation to compute a false RTT (m = rto - 0 = rto), creating a positive feedback loop that inflated the RTO to extreme values (e.g., 232 half-seconds = ~116 seconds). Fix: remove the work_available check so that tcp_update_retrantimer is always called when there is unacknowledged data. The decision to re-queue the work is handled internally by tcp_update_timer. Signed-off-by: zhekunren <zhekunren@qq.com>
zhekunren
force-pushed
the
fix/tcp-retransmit-timer-remove-work-available
branch
from
August 3, 2026 02:22
c127429 to
c3267f8
Compare
xiaoxiang781216
approved these changes
Aug 3, 2026
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.
Problem
The original condition
work_available(&conn->work) && tx_unacked != 0prevented
tcp_update_retrantimerfrom being called when the work queuewas still busy, leaving
conn->timerstale or zero. This caused the RTTestimation to compute a false RTT (
m = rto - 0 = rto), creating apositive feedback loop that inflated the RTO to extreme values (e.g.,
232 half-seconds = ~116 seconds).
Detailed Scenario
work_availableis true, the condition passes,conn->timeris set toconn->rto, and the work queue is scheduled.work_availableis false, thecondition fails,
tcp_update_retrantimeris not executed, andconn->timerkeeps its previous value.work_availableis still false, the timer is not reset; if the timer expires in the
meantime,
conn->timeris decremented to 0.conn->timeris 0, so the RTT estimation computesm = rto - 0 = rto, producing a bogus measurement.Fix
Remove the
work_availablecheck so thattcp_update_retrantimerisalways called when there is unacknowledged data. The decision to re-queue
the work is handled internally by
tcp_update_timer. This ensures:timeris always a freshly set value.m = rto - timertruthfully reflects the actual RTT.timer = 0is avoided.