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

3. Cleanup internal network request handler, fix unused request logging #3295

Merged
merged 4 commits into from
Jan 6, 2022

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Dec 24, 2021

Motivation

In PRs #3293 and #3294, we modify Zebra's internal request handling so it is simpler and more reliable.

This PR removes some workarounds and duplicate code that aren't needed any more.

Solution

  • Replace sending immediate responses with the new finished response handler code
  • Remove special cases and wrapper structs that aren't needed any more
  • Fix unused request logging

Review

This PR is ready for review, but it's based on PR #3294, so we should keep it in draft until that PR merges.

@upbqdn can review this PR.

Reviewer Checklist

  • Code implements Specs and Designs

I've tested this PR locally, and the regression in the address book metrics stays resolved.

It's hard to test this PR, because we don't have a lot of connection state handling tests. We should have better tests after we implement #1592.

@teor2345 teor2345 added C-cleanup Category: This is a cleanup P-Low A-network Area: Network protocol updates or fixes labels Dec 24, 2021
@teor2345 teor2345 self-assigned this Dec 24, 2021
@codecov
Copy link

codecov bot commented Dec 24, 2021

Codecov Report

Merging #3295 (65a07c5) into main (7e63182) will increase coverage by 0.16%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #3295      +/-   ##
==========================================
+ Coverage   77.18%   77.34%   +0.16%     
==========================================
  Files         265      265              
  Lines       31462    31415      -47     
==========================================
+ Hits        24283    24298      +15     
+ Misses       7179     7117      -62     

@teor2345 teor2345 added P-Medium and removed P-Low labels Dec 30, 2021
@teor2345
Copy link
Contributor Author

I made this medium priority, because it could block ticket #3234

@teor2345 teor2345 force-pushed the cache-unsolicited-addresses branch from 09c749b to c28fd01 Compare December 30, 2021 03:31
@teor2345 teor2345 force-pushed the cleanup-internal-request-init branch from 19f5f3d to 11a4017 Compare December 30, 2021 03:32
@teor2345 teor2345 force-pushed the cache-unsolicited-addresses branch from c28fd01 to 1153aa2 Compare January 4, 2022 23:56
@teor2345 teor2345 force-pushed the cleanup-internal-request-init branch from 11a4017 to f84edc8 Compare January 5, 2022 03:37
Base automatically changed from cache-unsolicited-addresses to main January 5, 2022 20:56
@teor2345 teor2345 requested a review from upbqdn January 5, 2022 21:37
@teor2345 teor2345 force-pushed the cleanup-internal-request-init branch from f84edc8 to e7598a0 Compare January 6, 2022 00:09
@teor2345 teor2345 marked this pull request as ready for review January 6, 2022 00:09
@teor2345 teor2345 changed the title 3. Cleanup internal network request handler 3. Cleanup internal network request handler, fix unused request logging Jan 6, 2022
@teor2345 teor2345 added the A-diagnostics Area: Diagnosing issues or monitoring performance label Jan 6, 2022
@teor2345 teor2345 enabled auto-merge (squash) January 6, 2022 00:12
Copy link
Member

@upbqdn upbqdn left a comment

Choose a reason for hiding this comment

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

LGTM, the code is cleaner. 👍 I just wasn't sure about the unused messages.

@teor2345 teor2345 requested a review from upbqdn January 6, 2022 20:02
upbqdn
upbqdn previously approved these changes Jan 6, 2022
Copy link
Member

@upbqdn upbqdn left a comment

Choose a reason for hiding this comment

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

Looks great. The new enum adds more semantics to the code.

Co-authored-by: Marek <mail@marek.onl>
@teor2345 teor2345 requested a review from upbqdn January 6, 2022 21:04
@teor2345
Copy link
Contributor Author

teor2345 commented Jan 6, 2022

The Google Cloud build failed due to a network error on a server we don't control:

Jan 06 21:07:45.532 INFO {zebrad="65a07c5" net="Main"}: zebrad::commands::download: checking if Zcash Sapling and Sprout parameters have been downloaded
Jan 06 21:07:45.533 INFO {zebrad="65a07c5" net="Main"}: zebra_consensus::primitives::groth16::params: downloading Zcash Sapling parameters
Jan 06 21:08:53.693 INFO {zebrad="65a07c5" net="Main"}: zebra_consensus::primitives::groth16::params: downloading Zcash Sprout parameters
Jan 06 21:19:45.984 INFO {zebrad="65a07c5" net="Main"}: zebra_consensus::primitives::groth16::params: error downloading Zcash Sprout parameters, retrying error=IoError(Custom { kind: Other, error: "sprout-groth16.params failed reading after https://download.z.cash/downloads/sprout-groth16.params.part.1 + https://download.z.cash/downloads/sprout-groth16.params.part.2 bytes, expected 494074384 bytes from 725523612, error: Custom { kind: Other, error: "download response failed: IoError(Os { code: 104, kind: ConnectionReset, message: \"Connection reset by peer\" })" }" })
Jan 06 21:24:04.349 INFO {zebrad="65a07c5" net="Main"}: zebra_consensus::primitives::groth16::params: error downloading Zcash Sprout parameters, retrying error=IoError(Custom { kind: Other, error: "sprout-groth16.params failed reading after https://download.z.cash/downloads/sprout-groth16.params.part.1 + https://download.z.cash/downloads/sprout-groth16.params.part.2 bytes, expected 195836432 bytes from 725523612, error: Custom { kind: Other, error: "download response failed: IoError(Os { code: 104, kind: ConnectionReset, message: \"Connection reset by peer\" })" }" })

So I'll just admin-merge when the rest of CI passes.

@teor2345 teor2345 disabled auto-merge January 6, 2022 22:05
@teor2345 teor2345 merged commit 4c310c0 into main Jan 6, 2022
@teor2345 teor2345 deleted the cleanup-internal-request-init branch January 6, 2022 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Diagnosing issues or monitoring performance A-network Area: Network protocol updates or fixes C-cleanup Category: This is a cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants