Repository navigation
net: Fix stale QUIC send times after a pause - #13479
Conversation
Since youtube#6188, QuicChromiumClock::ApproximateNow() returns a saved time that only arriving packets refresh. After a pause in a download, the next packet sent got the time from before the pause. QUIC saw it as seconds overdue and closed the connection, and the fetch failed with "network error". The saved time is now only used while arriving packets are handled. Everywhere else ApproximateNow() reads the clock. Test: net_unittests --gtest_filter='QuicChromiumClockTest.*' Test: Playback Analysis yts tests over QUIC, 0 network errors in 21 Bug: 532158865
|
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
There was a problem hiding this comment.
Code Review
This pull request replaces the 'ZeroApproximateNow()' method with a RAII-based 'ScopedApproximateNow' class in 'QuicChromiumClock' for Cobalt builds, ensuring that 'ApproximateNow()' only returns cached time within active scopes. The changes also update 'QuicChromiumPacketReader' to use this new scope and introduce unit tests. Feedback on these changes highlights three key areas for improvement: making the global static variables 'thread_local' to prevent data races in multi-threaded environments, fixing a bug where nested scopes prematurely clear the cached time upon inner scope destruction, and adding comments to document the threading model of the new class as required by the repository style guide.
ckim1346
left a comment
There was a problem hiding this comment.
LGTM w/ optional test coverage suggestion
jellefoks
left a comment
There was a problem hiding this comment.
This is awesome! I am stoked to see this fix.
Refer to original PR: #13479 Since #6188, QuicChromiumClock::ApproximateNow() returns a saved time that only arriving packets refresh. After a pause in a download, the next packet sent got the time from before the pause. QUIC saw it as seconds overdue and closed the connection, and the fetch failed with "network error". The saved time is now only used while arriving packets are handled. Everywhere else ApproximateNow() reads the clock. Test: net_unittests --gtest_filter='QuicChromiumClockTest.*' Test: Playback Analysis yts tests over QUIC, 0 network errors in 21 Bug: 532158865 (cherry picked from commit 16d2f9f)
Refer to original PR: #13479 Since #6188, QuicChromiumClock::ApproximateNow() returns a saved time that only arriving packets refresh. After a pause in a download, the next packet sent got the time from before the pause. QUIC saw it as seconds overdue and closed the connection, and the fetch failed with "network error". The saved time is now only used while arriving packets are handled. Everywhere else ApproximateNow() reads the clock. Test: net_unittests --gtest_filter='QuicChromiumClockTest.*' Test: Playback Analysis yts tests over QUIC, 0 network errors in 21 Bug: 532158865 (cherry picked from commit 16d2f9f)
Refer to original PR: #13479 Since #6188, QuicChromiumClock::ApproximateNow() returns a saved time that only arriving packets refresh. After a pause in a download, the next packet sent got the time from before the pause. QUIC saw it as seconds overdue and closed the connection, and the fetch failed with "network error". The saved time is now only used while arriving packets are handled. Everywhere else ApproximateNow() reads the clock. Test: net_unittests --gtest_filter='QuicChromiumClockTest.*' Test: Playback Analysis yts tests over QUIC, 0 network errors in 21 Bug: 532158865 (cherry picked from commit 16d2f9f)
Refer to original PR: #13479 Since #6188, QuicChromiumClock::ApproximateNow() returns a saved time that only arriving packets refresh. After a pause in a download, the next packet sent got the time from before the pause. QUIC saw it as seconds overdue and closed the connection, and the fetch failed with "network error". The saved time is now only used while arriving packets are handled. Everywhere else ApproximateNow() reads the clock. Test: net_unittests --gtest_filter='QuicChromiumClockTest.*' Test: Playback Analysis yts tests over QUIC, 0 network errors in 21 Bug: 532158865 (cherry picked from commit 16d2f9f)
…er a pause Refer to original PR: #13479 Since #4489 (#6188 on main), QuicChromiumClock::ApproximateNow() returns a saved time that only arriving packets refresh. After a pause in a download, the next packet sent got the time from before the pause. QUIC saw it as seconds overdue and closed the connection, and the fetch failed with "network error". The saved time is now only used while arriving packets are handled. Everywhere else ApproximateNow() reads the clock. Test: net_unittests --gtest_filter='QuicChromiumClockTest.*' (cherry picked from commit 16d2f9f) Bug: 532158865 TAG=agy CONV=b445991b-5706-491d-91f0-8f9c3d040204
…13720) [25.lts.1+] Cherry pick PR #13479: net: Fix stale QUIC send times after a pause Refer to original PR: #13479 Since #4489 (#6188 on main), QuicChromiumClock::ApproximateNow() returns a saved time that only arriving packets refresh. After a pause in a download, the next packet sent got the time from before the pause. QUIC saw it as seconds overdue and closed the connection, and the fetch failed with "network error". The saved time is now only used while arriving packets are handled. Everywhere else ApproximateNow() reads the clock. Test: net_unittests --gtest_filter='QuicChromiumClockTest.*' (cherry picked from commit 16d2f9f) Bug: 532158865 TAG=agy CONV=b445991b-5706-491d-91f0-8f9c3d040204
Since #6188, QuicChromiumClock::ApproximateNow() returns a saved time
that only arriving packets refresh. After a pause in a download, the
next packet sent got the time from before the pause. QUIC saw it as
seconds overdue and closed the connection, and the fetch failed with
"network error".
The saved time is now only used while arriving packets are handled.
Everywhere else ApproximateNow() reads the clock.
Test: net_unittests --gtest_filter='QuicChromiumClockTest.*'
Test: Playback Analysis yts tests over QUIC, 0 network errors in 21
Bug: 532158865