Expose InternalServer as a transport attribute in ServerImpl#12668
Open
vlcekmilan wants to merge 1 commit intogrpc:masterfrom
Open
Expose InternalServer as a transport attribute in ServerImpl#12668vlcekmilan wants to merge 1 commit intogrpc:masterfrom
vlcekmilan wants to merge 1 commit intogrpc:masterfrom
Conversation
|
|
6e9994a to
1e53d90
Compare
1e53d90 to
d49ab2f
Compare
Author
|
Hello @ejona86, could you pls review this? |
Member
That's internal. We're definitely not going to expose it directly. We'd have to do something indirectly.
How is a session established?
Is authentication an RPC, or part of TLS handshake? Or are you doing something with ServerTransportFilter? |
Member
FWIW, predictable expiration could potentially be handled by maxConnectionAge(). But if sessions can be suddenly invalidated, that's quite a different thing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change exposes the InternalServer as a transport-level attribute on ServerTransportListenerImpl, making it available to ServerTransportFilter implementations and downstream consumers via Attributes.
Changes
Why
We need access to the underlying ServerTransport from within a ServerInterceptor to force-close the transport connection when an external session expires.
In our use case, we have a ServerInterceptor that authenticates incoming RPCs against an external session management system. When a session isestablished, we register a close handler on it. If the external session is later invalidated or expires, the close handler fires and needs to shut down the underlying transport so the client is forced to reconnect and re-authenticate.
Currently, there is no way for a ServerInterceptor to access the transport layer to force-close a connection. The interceptor can reject individual RPCs via call.close(Status.UNAUTHENTICATED, ...), but it cannot terminate the transport itself.