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

Interceptors do not block onHalfClose if they block the message #240

Closed
jGleitz opened this issue Sep 6, 2021 · 0 comments · Fixed by #241
Closed

Interceptors do not block onHalfClose if they block the message #240

jGleitz opened this issue Sep 6, 2021 · 0 comments · Fixed by #241
Labels
bug Auto-generates notes
Milestone

Comments

@jGleitz
Copy link
Contributor

jGleitz commented Sep 6, 2021

Both SecurityInterceptor and ValidatingInterceptor can block the onMessage signal of a client if the message is erroneous. However, both interceptors will still pass through the onHalfClose signal that the client issues shortly after the message (for single-message calls). For a downstream instance, this looks like the client never sent a message, but did send a half-close. UnaryServerCallHandler (correctly) throws an error in this scenario. This error is irritating: it happens after the call was already closed and looks like there was a problem with the request, even though it has already completed successfully, from the server’s point of view.

From my point of view, the solution is to block onHalfClose also if onMessage was blocked. From the point of view of a downstream instance, it will then look like the client never send a message.

jGleitz added a commit to jGleitz/grpc-spring-boot-starter that referenced this issue Sep 6, 2021
jvmlet pushed a commit that referenced this issue Sep 13, 2021
* test that SecurityInterceptor does not propagate onHalfClose after closing the request

* set the locale in ValidationTest so it passes on non-English systems

* test that ValidatingInterceptor does not propagate onHalfClose after closing the request

* also block onHalfClose after blocking onMessage

fixes #240
@jvmlet jvmlet added the bug Auto-generates notes label Sep 13, 2021
@jvmlet jvmlet added this to the 4.5.7 milestone Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Auto-generates notes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants