Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Flip iter operations to keep associated address/header/packets together #22245

Merged
merged 2 commits into from
Jan 3, 2022

Conversation

steviez
Copy link
Contributor

@steviez steviez commented Jan 3, 2022

Problem

Before this change, if cast_socket_addr() returned a None for any
address/header pair, the subsequent zip() would misalign the
address/header pair and packet.

Summary of Changes

So, this change zips all three together,
then does filter_map() so keep things aligned.

Additionally, compute total_size inline to avoid running through packets
a second time.

Before this change, if cast_socket_addr() returned a None for any
address/header pair, the subsequent zip() would misalign the
address/header pair and packet. So, this change zips all three together,
then does filter_map() so keep things aligned.

Additionally, compute total_size inline to avoid running through packets
a second time.
@steviez steviez requested a review from behzadnouri January 3, 2022 20:00
@steviez steviez marked this pull request as ready for review January 3, 2022 20:00
behzadnouri
behzadnouri previously approved these changes Jan 3, 2022
Copy link
Contributor

@behzadnouri behzadnouri left a comment

Choose a reason for hiding this comment

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

thanks for spotting this.

streamer/src/recvmmsg.rs Outdated Show resolved Hide resolved
@mergify mergify bot dismissed behzadnouri’s stale review January 3, 2022 20:33

Pull request has been modified.

@codecov
Copy link

codecov bot commented Jan 3, 2022

Codecov Report

Merging #22245 (26923c5) into master (9029b46) will decrease coverage by 0.0%.
The diff coverage is 100.0%.

@@            Coverage Diff            @@
##           master   #22245     +/-   ##
=========================================
- Coverage    81.0%    81.0%   -0.1%     
=========================================
  Files         523      523             
  Lines      146529   146528      -1     
=========================================
- Hits       118769   118767      -2     
- Misses      27760    27761      +1     

@steviez steviez merged commit 20b61e2 into solana-labs:master Jan 3, 2022
@steviez steviez deleted the streamer_recv branch January 3, 2022 23:15
mergify bot pushed a commit that referenced this pull request Jan 3, 2022
…er (#22245)

Flip iter operations to keep associated address/header/packets together

Before this change, if cast_socket_addr() returned a None for any
address/header pair, the subsequent zip() would misalign the
address/header pair and packet. So, this change zips all three together,
then does filter_map() so keep things aligned.

Additionally, compute total_size inline to avoid running through packets
a second time.

(cherry picked from commit 20b61e2)

# Conflicts:
#	streamer/src/recvmmsg.rs
mergify bot pushed a commit that referenced this pull request Jan 3, 2022
…er (#22245)

Flip iter operations to keep associated address/header/packets together

Before this change, if cast_socket_addr() returned a None for any
address/header pair, the subsequent zip() would misalign the
address/header pair and packet. So, this change zips all three together,
then does filter_map() so keep things aligned.

Additionally, compute total_size inline to avoid running through packets
a second time.

(cherry picked from commit 20b61e2)
mergify bot added a commit that referenced this pull request Jan 4, 2022
…er (#22245) (#22257)

Flip iter operations to keep associated address/header/packets together

Before this change, if cast_socket_addr() returned a None for any
address/header pair, the subsequent zip() would misalign the
address/header pair and packet. So, this change zips all three together,
then does filter_map() so keep things aligned.

Additionally, compute total_size inline to avoid running through packets
a second time.

(cherry picked from commit 20b61e2)

Co-authored-by: steviez <[email protected]>
mergify bot added a commit that referenced this pull request Jan 4, 2022
…er (backport #22245) (#22256)

* Flip iter operations to keep associated address/header/packets together (#22245)

Flip iter operations to keep associated address/header/packets together

Before this change, if cast_socket_addr() returned a None for any
address/header pair, the subsequent zip() would misalign the
address/header pair and packet. So, this change zips all three together,
then does filter_map() so keep things aligned.

Additionally, compute total_size inline to avoid running through packets
a second time.

(cherry picked from commit 20b61e2)

# Conflicts:
#	streamer/src/recvmmsg.rs

* removes backport merge conflicts

Co-authored-by: steviez <[email protected]>
Co-authored-by: behzad nouri <[email protected]>
@brooksprumo brooksprumo mentioned this pull request Jan 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants