Skip to content
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

Fix SelfRateLimiter breaks the sequence of delayed_requests. #5903

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

ackintosh
Copy link
Member

Issue Addressed

I noticed that SelfRateLimiter::next_peer_request_ready() breaks the sequence of the requests in its delayed_requests.

For example, if there are RequestIds in delayed_requests in the sequence of 2, 3, 4, 5. After running next_peer_request_ready(), the sequence will be 4, 5, 3 although we expect 3, 4, 5. This happens because push_back is used to requeue.

Proposed Changes

Use push_front instead of push_back to maintain the correct sequence of requests.

@ackintosh ackintosh added ready-for-review The code is ready for review Networking labels Jun 8, 2024
@ackintosh ackintosh marked this pull request as ready for review June 8, 2024 22:55
@ackintosh ackintosh requested review from jxs and AgeManning June 8, 2024 22:55
Copy link
Member

@AgeManning AgeManning left a comment

Choose a reason for hiding this comment

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

Oh yeah. Nice catch!

@AgeManning AgeManning added v5.2.1 Patch release for v5.2.0 ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Jun 18, 2024
@AgeManning
Copy link
Member

@Mergifyio queue

Copy link

mergify bot commented Jun 18, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at c2838ba

mergify bot added a commit that referenced this pull request Jun 18, 2024
@mergify mergify bot merged commit c2838ba into sigp:unstable Jun 18, 2024
28 checks passed
@ackintosh ackintosh deleted the self-limiter-next_peer_request_ready branch June 18, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Networking ready-for-merge This PR is ready to merge. v5.2.1 Patch release for v5.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants