-
Notifications
You must be signed in to change notification settings - Fork 165
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
Support StatusException in CoroutineContextServerInterceptor. #249
Merged
jamesward
merged 6 commits into
grpc:master
from
hovinen:support-status-exception-in-coroutine-context-server-interceptor
Oct 12, 2021
Merged
Support StatusException in CoroutineContextServerInterceptor. #249
jamesward
merged 6 commits into
grpc:master
from
hovinen:support-status-exception-in-coroutine-context-server-interceptor
Oct 12, 2021
Conversation
This file contains 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
|
hovinen
force-pushed
the
support-status-exception-in-coroutine-context-server-interceptor
branch
from
April 19, 2021 09:12
e61336a
to
e74cc82
Compare
lowasser
requested changes
Apr 19, 2021
stub/src/main/java/io/grpc/kotlin/CoroutineContextServerInterceptor.kt
Outdated
Show resolved
Hide resolved
stub/src/main/java/io/grpc/kotlin/CoroutineContextServerInterceptor.kt
Outdated
Show resolved
Hide resolved
stub/src/test/java/io/grpc/kotlin/CoroutineContextServerInterceptorTest.kt
Outdated
Show resolved
Hide resolved
Previously, there was no way for a subclass of CoroutineContextServerInterceptor to close a call and prevent further processing. The interceptor would unconditionally invoke the next handler in the chain unless prevented by an exception. If the coroutineContext method threw an exception, it would bubble up to the thread pool and show up in the logs as an error. This change adds a handler for StatusException in CoroutineContextServerInterceptor to catch a StatusException and close the call with no further action. Fixes grpc#221
hovinen
force-pushed
the
support-status-exception-in-coroutine-context-server-interceptor
branch
from
April 20, 2021 08:49
e74cc82
to
734cb1c
Compare
…ext-server-interceptor
…ext-server-interceptor
…ext-server-interceptor
…ext-server-interceptor
lowasser
reviewed
Oct 4, 2021
stub/src/main/java/io/grpc/kotlin/CoroutineContextServerInterceptor.kt
Outdated
Show resolved
Hide resolved
Ping @hovinen - I want to get this in for the 1.2.0 release and it looks like we just need one more change. |
lowasser
approved these changes
Oct 12, 2021
This works. I was imagining an |
Thanks @hovinen! |
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.
Previously, there was no way for a subclass of CoroutineContextServerInterceptor to close a call and prevent further processing. The interceptor would unconditionally invoke the next handler in the chain unless prevented by an exception. If the coroutineContext method threw an exception, it would bubble up to the thread pool and show up in the logs as an error.
This change adds a handler for StatusException in CoroutineContextServerInterceptor to catch a StatusException and close the call with no further action.
Fixes #221