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

Investigate GRPC context propagation #159

Open
FroMage opened this issue May 6, 2019 · 3 comments
Open

Investigate GRPC context propagation #159

FroMage opened this issue May 6, 2019 · 3 comments

Comments

@FroMage
Copy link
Contributor

FroMage commented May 6, 2019

It appears GRPC has support for manual context propagation, by providing a storage mechanism. It's not entirely clear to me if it's pluggable or not, but it looks similar in use-case to what we do here. We should check it out and see if we can implement GRPC context propagation with MP-CP (to allow MP-CP users to not have to deal with two CP APIs at the same time to get both GRPC and other contexts), and possibly get in touch with them to talk about it.

@FroMage
Copy link
Contributor Author

FroMage commented May 6, 2019

@njr-11
Copy link
Contributor

njr-11 commented May 6, 2019

@FroMage Thanks for finding that. It does seem to have a lot of similarities, as well as some additional capabilities like the timeout on the validity of context. At least for the common parts, it should hopefully be possible to create a ThreadContextProvider for GRPC that would, as you mention, allow the user to deal with a single common API.

@njr-11
Copy link
Contributor

njr-11 commented May 13, 2019

I can see one obstacle to plugging in gRPC context, which is that there does not appear to be any way to establish a default/empty context on a thread. At first glance I thought Context.ROOT might have been helpful here, however, it clearly states that it is not be used as the context for new threads. To move ahead with this, I think we either need gRPC to supply a ThreadContextProvider impl itself or to at least expose the necessary API by which a cleared/empty context can be obtained. Given that, should we consider this issue as a possible enhancement for vNext ?

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