Skip to content

ackhandler: check for missing packets below reordering treshold #5260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marten-seemann
Copy link
Member

No functional change expected.

For #2482.

With the Acknowledgement Frequency extension, the reordering threshold will become configurable. With this change, it will be easy to use the peer-requested value instead of the predefined constant.

@marten-seemann marten-seemann requested a review from Copilot July 14, 2025 14:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR makes the reordering threshold in the ACK handler configurable and updates the missing‐packet detection logic accordingly, along with test refactors for stability and a new packet‐history method.

  • Introduce reorderingThreshold constant and adjust hasNewMissingPackets logic to account for it
  • Replace the old GetHighestAckRange API with HighestMissingUpTo, initialize deletedBelow, and update tests for that change
  • Refactor tests to use a fixed now timestamp instead of multiple time.Now() calls

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
internal/ackhandler/received_packet_tracker.go Added reorderingThreshold const and updated hasNewMissingPackets to use it
internal/ackhandler/received_packet_tracker_test.go Refactored loops and consolidated timestamps in tests (introduced loop syntax bugs)
internal/ackhandler/received_packet_history.go Initialized deletedBelow and implemented HighestMissingUpTo in place of old API
internal/ackhandler/received_packet_history_test.go Updated tests to call HighestMissingUpTo and changed loop constructs (bugs)
Comments suppressed due to low confidence (3)

internal/ackhandler/received_packet_tracker_test.go:58

  • The loop syntax for range 2 is invalid in Go. Replace it with a standard index loop, for example: for i := 0; i < 2; i++ {.
	for range 2 {

internal/ackhandler/received_packet_tracker_test.go:62

  • The loop syntax for range 3 is invalid in Go. Use an index-based loop instead, like: for i := 0; i < 3; i++ {.
	for range 3 {

internal/ackhandler/received_packet_history_test.go:184

  • You cannot range over an integer. Change to an index loop, for example: for i := 0; i < num; i++ {.
	for i := range num {

Copy link

codecov bot commented Jul 14, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.39%. Comparing base (afe01ef) to head (8832b26).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
internal/ackhandler/received_packet_tracker.go 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5260      +/-   ##
==========================================
+ Coverage   84.30%   84.39%   +0.09%     
==========================================
  Files         154      154              
  Lines       17635    17654      +19     
==========================================
+ Hits        14866    14898      +32     
+ Misses       2206     2196      -10     
+ Partials      563      560       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

No functional change expected.

With the Acknowledgement Frequency extension, the reordering threshold
will become configurable. With this change, it will be easy to use the
peer-requested value instead of the predefined constant.
@marten-seemann marten-seemann force-pushed the ackhandler-reordering-threshold branch from 079e36d to 8832b26 Compare July 14, 2025 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant