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

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

Merged
steviez merged 2 commits intosolana-labs:masterfrom
steviez:streamer_recv
Jan 3, 2022
Merged

Flip iter operations to keep associated address/header/packets together#22245
steviez merged 2 commits intosolana-labs:masterfrom
steviez:streamer_recv

Conversation

@steviez
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread streamer/src/recvmmsg.rs Outdated
@mergify mergify Bot dismissed behzadnouri’s stale review January 3, 2022 20:33

Pull request has been modified.

@codecov
Copy link
Copy Markdown

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 <steven@solana.com>
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 <steven@solana.com>
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
@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