Repository navigation
Fix congestion window wrap-around on latency spike - #2185
Conversation
Since da8904c a latency spike (diff > 100) both scales the congestion window proportionally and always subtracts an additional 4 KiB. This could have the unintended effect that the unsigned congWindow, potentially below 4 KiB at the point of the subtraction, wraps around and gets clamped to MAXIMUM_WINDOW. This fix avoids the wrap around and makes the spike handling and congestion avoidance mutually exclusive.
|
When does this occur? Can it be easily tested? |
|
It looks like your commit email doesn't match what you have registered at GitHub? The commit isn't attributed to you. |
Looks like the domain used in my local configuration (.se) didn't match my github account (.com). Should be fixed now. |
It happens when the server detects a latency spike (meeting a certain condition) and the congestion window happens to currently sit at a value such that the proportional adjustment factor The ratio above is between the estimated base latency of the network (baseRTT) and the minimum measured latency (minRTT) since the last window adjustment (based on a short series of measurements). As seen in If the first adjustment sent
I've managed to reproduce this a couple of times by having the server send quite small screen updates (some text fluttering in the corner of a terminal window) on an unthrottled network and then suddenly throttling it to 300ms. With some added debug logging I could observe for instance the congestion window at 128 KiB on entering |
This PR fixes a potential unsigned wrap-around for the congestion window which has the unintended consequence of setting it to the maximum window value as opposed to keeping it low.
This also avoids double adjustment of the window by making the two branches (latency spike and congestion avoidance) mutually exclusive.