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

prunes repair QUIC connections #33775

Merged

Conversation

behzadnouri
Copy link
Contributor

Problem

The number of outstanding connections can grow boundlessly.

Summary of Changes

The commit implements lazy eviction for repair QUIC connections. The cache is allowed to grow to 2 x capacity at which point at least half of the entries with lowest stake are evicted, resulting in an amortized O(1) performance.

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #33775 (8f57832) into master (f13c78b) will increase coverage by 0.0%.
Report is 3 commits behind head on master.
The diff coverage is 58.6%.

@@           Coverage Diff           @@
##           master   #33775   +/-   ##
=======================================
  Coverage    81.8%    81.8%           
=======================================
  Files         807      807           
  Lines      218018   218104   +86     
=======================================
+ Hits       178367   178449   +82     
- Misses      39651    39655    +4     

for (_, (_, connection)) in &connections[CONNECTION_CACHE_CAPACITY..] {
connection.close(
CONNECTION_CLOSE_ERROR_CODE_DROPPED,
CONNECTION_CLOSE_REASON_DROPPED,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should have better code and reason for example "too many"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to ..._PRUNED.

lijunwangs
lijunwangs previously approved these changes Oct 19, 2023
The commit implements lazy eviction for repair QUIC connections.
The cache is allowed to grow to 2 x capacity at which point at least
half of the entries with lowest stake are evicted, resulting in an
amortized O(1) performance.
@behzadnouri
Copy link
Contributor Author

@lijunwangs I needed to make a minor change. can you please re-approve?

Copy link
Contributor

@lijunwangs lijunwangs left a comment

Choose a reason for hiding this comment

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

lgtm

@behzadnouri behzadnouri merged commit dc3c827 into solana-labs:master Oct 20, 2023
31 checks passed
@behzadnouri behzadnouri deleted the repair-quic-cache-eviction branch October 20, 2023 17:50
@behzadnouri behzadnouri added the v1.17 PRs that should be backported to v1.17 label Oct 20, 2023
mergify bot pushed a commit that referenced this pull request Oct 20, 2023
The commit implements lazy eviction for repair QUIC connections.
The cache is allowed to grow to 2 x capacity at which point at least
half of the entries with lowest stake are evicted, resulting in an
amortized O(1) performance.

(cherry picked from commit dc3c827)
mergify bot added a commit that referenced this pull request Oct 20, 2023
prunes repair QUIC connections (#33775)

The commit implements lazy eviction for repair QUIC connections.
The cache is allowed to grow to 2 x capacity at which point at least
half of the entries with lowest stake are evicted, resulting in an
amortized O(1) performance.

(cherry picked from commit dc3c827)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.17 PRs that should be backported to v1.17
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants