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

multi: Convert rpcserver lifecycle to context. #2043

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

dnldd
Copy link
Member

@dnldd dnldd commented Jan 27, 2020

This updates the rpcserver and wsNotificationManager lifecycle processes to use a context.

Resolves #2037

@dnldd dnldd changed the title multi: Convert rpcsever lifecycle to context. multi: Convert rpcserver lifecycle to context. Jan 27, 2020
rpcserver.go Outdated Show resolved Hide resolved
rpcserver.go Outdated Show resolved Hide resolved
rpcwebsocket.go Outdated Show resolved Hide resolved
rpcserver.go Outdated Show resolved Hide resolved
rpcwebsocket.go Outdated Show resolved Hide resolved
Copy link
Member

@matheusd matheusd left a comment

Choose a reason for hiding this comment

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

Seems fine now!

Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

The overall approach looks good with the most recent iteration. Nice work so far. I did mention a final area for improvement in regards to the notifications with the inline comments as well as a couple of other very minor things.

I also manually tested the changes I recommended to the notifications via various RPC clients and the race detector to ensure the suggestion works as intended.

Finally, I gave this a thorough review and verified that there are no more call sites that are attempting to send on channels serviced by goroutines spawned by the RPC server and notification manager which aren't ultimately selecting across a channel with the context which could lead to a hang if the goroutines were to disappear out from under it.

rpcserver.go Show resolved Hide resolved
rpcwebsocket.go Outdated Show resolved Hide resolved
rpcwebsocket.go Outdated Show resolved Hide resolved
This updates the rpcserver and wsNotificationManager
lifecycle processes to use a context.
@davecgh davecgh merged commit e0bdb8f into decred:master Feb 13, 2020
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.

Shutdown race
3 participants