Remove grpc_httpcli_context#27867
Conversation
|
I'd like @ctiller to weigh in on this to confirm my understanding and reasoning here. However, I'm not sure that this PR is the right approach, for two reasons. First, I believe that the reason Second, even if |
Right, I also initially thought that this polling problem necessitated the shared context object, but it looks like all callers are actually already solving this problem by merging interested parties into Here's my audit of all non-test usages of
I also see one usage of
Indeed the presence of the |
|
Note, there is also one more usage of But again, the pollent parameter in use there is the resolver's pollset set, and interested parties must have already been merged into that, otherwise the polling problem referred to would exist for resolvers on all other I/O. |
|
Mark's right on the original intent (to share polling context between requests), and I think Alex is right on the current status (we just don't actually)... and that status is going to become unchangeable soon as we remove pollset_set anyway. I also agree with Alex on the thinking that we'll want to return some handle to cancel with from get/post. I also agree with Mark on the reasoning that it needn't be awkward. That said, we're asking clients to carry state that we don't use, and I think enough time has passed since I wrote this thing that we can safely say that we probably won't add another use for it in the near term, so I think my vote lands on let's delete the thing and simplify calling code. |
markdroth
left a comment
There was a problem hiding this comment.
Okay, if we're already handling the pollset merging a different way, then I'm fine with this.
Craig, thanks for the sanity-check!
grpc_httpcli_contextcurrently has just agrpc_pollset_setfield, which seems to only be necessary in order to wrap thegrpc_httpcli_{get,post}pollent parameter in the case that pollent is agrpc_pollset. We can remove the need for callers to manage this and manage it within the requests themselves.Motivation: I'm trying to add cancellation support to
grpc_httpcli_{get,post}. My first idea was to leveragegrpc_httpcli_contextto do the cancellation with something along the lines ofgrpc_httpcli_cancel(context), but that doesn't work out well becausegrpc_httpcli_contextcan be used across multiple requests. So we'd need to instead return something fromgrpc_httpcli_{get,post}which tracks the request and can do cancellation, but it seems odd for something like that to co-exist withgrpc_httpcli_context.