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

Plumb a context in to the server.Loop call. #749

Merged
merged 1 commit into from
Jan 4, 2022
Merged

Plumb a context in to the server.Loop call. #749

merged 1 commit into from
Jan 4, 2022

Conversation

creachadair
Copy link
Contributor

No description provided.

@jpogran
Copy link
Contributor

jpogran commented Jan 3, 2022

@creachadair can you describe what this PR fixes/solves? There is little detail or context here. Is there a reason you're targeting this at a branch and not main?

@creachadair
Copy link
Contributor Author

@creachadair can you describe what this PR fixes/solves? There is little detail or context here. Is there a reason you're targeting this at a branch and not main?

Hi @jpogran, sorry for not including more detail. This patch is updating the API usage for the github.com/creachadair/jrpc2 dependency, so that Dependabot can merge its change. That's why it's targeted at the dependabot PR, though it could just as well be done separately (and I would be glad to send such a PR if you'd prefer it).

Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

The "context plumbing" still needs some tidying in various places and I reckon that we'll want to pass some cancellable context here eventually, but the TCP mode is used only rarely, for debugging and the TODO() is fine for now anyway as it doesn't change the existing implementation anyway from what I can tell.

Thanks for the PR!

@radeksimko radeksimko merged commit 32e823e into hashicorp:dependabot/go_modules/github.com/creachadair/jrpc2-0.35.2 Jan 4, 2022
@creachadair
Copy link
Contributor Author

the TODO() is fine for now anyway as it doesn't change the existing implementation anyway from what I can tell.

That’s correct. A background context preserves the existing behaviour without a context.

The main reason to add a non-trivial context here would be if you need to stop a loop and cancel all its running instances. When the listener closes, the loop stops accepting new connections but does not return until the servers that are already running have terminated normally. The context ending explicitly stops those servers first.

@creachadair creachadair deleted the dependabot/go_modules/github.com/creachadair/jrpc2-0.35.2 branch January 4, 2022 16:20
@github-actions
Copy link

github-actions bot commented Feb 4, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants