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

Shutdown server runtime before program exit #8313

Merged
merged 1 commit into from
Feb 15, 2023
Merged

Conversation

sadhansood
Copy link
Contributor

We don't ever terminate the server runtime in benchmark when we exit the program. This causes RocksDB running in the server runtime to try to access global state which is cleaned up during exit. This PR terminates the server runtime with a oneshot channel and then exit.
Before this fix, I can reproduce the error in almost every run on my linux computer. After this PR, I did not run into any errors even after 10+ runs.

@vercel
Copy link

vercel bot commented Feb 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Ignored Deployments
Name Status Preview Comments Updated
explorer ⬜️ Ignored (Inspect) Feb 15, 2023 at 6:41PM (UTC)
explorer-storybook ⬜️ Ignored (Inspect) Feb 15, 2023 at 6:41PM (UTC)
frenemies ⬜️ Ignored (Inspect) Feb 15, 2023 at 6:41PM (UTC)
wallet-adapter ⬜️ Ignored (Inspect) Feb 15, 2023 at 6:41PM (UTC)

@@ -41,13 +42,19 @@ pub struct ProxyGasAndCoin {
pub pay_coin_type_tag: TypeTag,
}

pub struct BenchmarkSetup {
pub server_handle: JoinHandle<()>,
pub sender: oneshot::Sender<()>,
Copy link
Member

Choose a reason for hiding this comment

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

Can we give this a more descriptive name, e.g. shutdown_notifier?

@mwtian
Copy link
Member

mwtian commented Feb 15, 2023

Great!

@sadhansood sadhansood enabled auto-merge (squash) February 15, 2023 18:43
@sadhansood sadhansood merged commit 7a661d1 into main Feb 15, 2023
@sadhansood sadhansood deleted the sadhan/graceful branch February 15, 2023 19:00
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