Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Wait for RPC server to cleanup on shutdown#5004

Merged
bkchr merged 1 commit into
masterfrom
a-shutdown-rpc
Feb 21, 2020
Merged

Wait for RPC server to cleanup on shutdown#5004
bkchr merged 1 commit into
masterfrom
a-shutdown-rpc

Conversation

@arkpar
Copy link
Copy Markdown
Member

@arkpar arkpar commented Feb 20, 2020

RPC servers currently don't wait for worker threads to cleanup. This may result in RPC handlers, which contain a reference to the DB, to be still alive when the main thread terminates, leading to segfaults.

@tomusdrw perhaps http::Server should wait on drop internally?

@arkpar arkpar added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes labels Feb 20, 2020
@tomusdrw
Copy link
Copy Markdown
Contributor

The WS server for sure does:
https://github.com/paritytech/jsonrpc/blob/ef44a62c543fd969dd5bedf5a4ece3f3814bb111/ws/src/server.rs#L150

I was sure that HTTP server does as well, but it seems not. Will make a PR upstream.

@bkchr bkchr merged commit 32c08d4 into master Feb 21, 2020
@bkchr bkchr deleted the a-shutdown-rpc branch February 21, 2020 10:47
@arkpar
Copy link
Copy Markdown
Member Author

arkpar commented Feb 21, 2020

Should be reverted once jsonrpc with paritytech/jsonrpc#543 is released

General-Beck pushed a commit to General-Beck/substrate that referenced this pull request Mar 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants