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

reduce memory footprint of undecryptable packet handling #2932

Merged
merged 3 commits into from
Dec 14, 2020

Conversation

marten-seemann
Copy link
Member

  1. Don't preallocate a slice for undecryptable packets. We only ever expect to receive undecryptable packets in the case of reordering or packet loss during the handshake.
  2. Drop the slice used for undecryptable packets when the handshake completes. We won't queue any undecryptable packets after the handshake (as it's not possible that any undecryptable packet will become decryptable later), so we can hand the slice back to the GC.
  3. Assert that we actually don't try to queue undecryptable packets.

Under normal conditions, we don't expect to receive any undecryptable
packets. We expect to receive a few when there's packet loss and / or
reordering during the handshake, but even in that case the number will
most likely be smaller than protocol.MaxUndecryptablePackets.
@codecov
Copy link

codecov bot commented Dec 11, 2020

Codecov Report

Merging #2932 (c8626d8) into master (deacefd) will decrease coverage by 0.02%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2932      +/-   ##
==========================================
- Coverage   86.22%   86.20%   -0.02%     
==========================================
  Files         132      132              
  Lines        9141     9143       +2     
==========================================
  Hits         7881     7881              
- Misses        910      911       +1     
- Partials      350      351       +1     
Impacted Files Coverage Δ
session.go 79.23% <33.33%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update deacefd...c8626d8. Read the comment docs.

@marten-seemann marten-seemann changed the title improve memory footprint of undecryptable packet handling reduce memory footprint of undecryptable packet handling Dec 11, 2020
@marten-seemann marten-seemann merged commit a769e82 into master Dec 14, 2020
@marten-seemann marten-seemann deleted the undecryptable-packets-allocation branch December 15, 2020 03:08
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
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.

2 participants