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

ApiServer should shutdown gracefully #3649

Closed
snape479 opened this issue Jul 10, 2021 · 1 comment
Closed

ApiServer should shutdown gracefully #3649

snape479 opened this issue Jul 10, 2021 · 1 comment

Comments

@snape479
Copy link
Contributor

snape479 commented Jul 10, 2021

Previously, 'with_graceful_shutdown' was added to allow the ApiServer to shutdown gracefully here:

4a09fed

However, it had to be reverted due to the fact that the 'rx' was being dropped at the end of the code block and a 'cancel' error occurred right away. The solution to this problem is to store the (tx, rx) on the heap using Box and moving them to the startup routines in src/bin/grin.rs. Additionally, a monitor thread is needed to call stop when the StopState indicates the server stopped.

I have implemented this in bitcoinmw here:

bitcoinmw@2f25ec2

I was going to do a pull request to Grin, but my repo had some merge issues (due to verifier_cache). If someone could copy these changes from BMW over to Grin that would be great. Opening this issue to track.

@phyro
Copy link
Member

phyro commented Jan 7, 2022

I believe this is now resolved. Thanks for the issue and the fix.

@phyro phyro closed this as completed Jan 7, 2022
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

No branches or pull requests

2 participants