You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've written a custom implementation of a com.google.auth.Credentials class which retrieves tokens from etcd (using their v3 gRPC api). I'm attempting to trace these method calls by using the Context to link work done on separate threads. I've discovered that the Context is not available in my Credentials class (specifically when getRequestMetadata is called using an executor).
I've been able to work around this temporarily by changing:
Is it expected that the Context be available for use in a custom Credentials implementation? By doing so, this might also help to close some other open issues (#4929) and also allow deadline propagation to work properly when authenticating against a gRPC api.
The text was updated successfully, but these errors were encountered:
@pkwarren's Credentials propagates the Context within getRequestMetadata()
For 1 and 2, there's also the question of whether it should be a Context.fixedContextExecutor() or Context.currentContextExecutor().
Interestingly, would are almost using fixedContextExecutor() today, as ClientCallImpl uses ContextRunnables instead of fixedContextExecutor() for reduced allocations. However, CallCredentialsApplyingTransportFactory re-discovers the executor; if ClientCallImpl wrapped the executor it wouldn't notice.
In general, using Context.currentContextExecutor() should be preferred over Context.fixedContextExecutor().
What version of gRPC are you using?
1.18.0
What did you expect to see?
I've written a custom implementation of a
com.google.auth.Credentials
class which retrieves tokens from etcd (using their v3 gRPC api). I'm attempting to trace these method calls by using the Context to link work done on separate threads. I've discovered that the Context is not available in my Credentials class (specifically whengetRequestMetadata
is called using an executor).I've been able to work around this temporarily by changing:
to:
Is it expected that the Context be available for use in a custom Credentials implementation? By doing so, this might also help to close some other open issues (#4929) and also allow deadline propagation to work properly when authenticating against a gRPC api.
The text was updated successfully, but these errors were encountered: