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

Re-order Zebra startup, so slow services are launched last #3091

Merged
merged 7 commits into from
Nov 23, 2021

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Nov 23, 2021

Motivation

  1. Some of Zebra's network conflict tests are failing. This is probably happening due to PR Download Zcash Sapling parameters and load them from cached files #3057, which added a download task to verifier setup.

  2. Zebra can be slow to shut down. The new download task in PR Download Zcash Sapling parameters and load them from cached files #3057 could make this problem worse.

This is unexpected work in Sprint 23, but we could call it part of ticket #3037 if we want.

Solution

  • Send all of the inbound service's arguments via a channel
  • Start up the network service before the verifier service
  • Shut down as soon as a shut down signal is received. Ignore any other concurrent futures or blocking threads.

Review

This PR fixes CI failures, so it's pretty important.
It blocks PR #3085, which makes the download task much bigger.

@conradoplg was interested in fixing this issue, but anyone whose PRs are failing should review it.

Reviewer Checklist

  • Code refactor makes sense
  • New changes make sense
  • Existing tests pass

Follow Up Work

@teor2345 teor2345 added C-bug Category: This is a bug A-rust Area: Updates to Rust code P-High I-integration-fail Continuous integration fails, including build and test failures A-network Area: Network protocol updates or fixes labels Nov 23, 2021
@teor2345 teor2345 added this to the 2021 Sprint 23 milestone Nov 23, 2021
@teor2345 teor2345 requested a review from a team November 23, 2021 02:09
@teor2345 teor2345 self-assigned this Nov 23, 2021
@teor2345 teor2345 enabled auto-merge (squash) November 23, 2021 02:14
Pass all dependent services to the inbound service via a channel.
This means we can initialize more services after the inbound service.
This makes the Groth16 download task start as late as possible.
@teor2345
Copy link
Contributor Author

This PR might even cut a few minutes off our CI times, because expected failures happen faster.

Copy link
Collaborator

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

Looks good!

zebrad/src/components/tokio.rs Show resolved Hide resolved
@teor2345 teor2345 merged commit 68d7198 into main Nov 23, 2021
@teor2345 teor2345 deleted the startup-slow-services-last branch November 23, 2021 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-network Area: Network protocol updates or fixes A-rust Area: Updates to Rust code C-bug Category: This is a bug I-integration-fail Continuous integration fails, including build and test failures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants