-
Notifications
You must be signed in to change notification settings - Fork 4k
stub: ignore unary response msg if status is not OK for async server #6296
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
base: master
Are you sure you want to change the base?
Conversation
creamsoup
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| .asRuntimeException(); | ||
| } | ||
| if (error != null) { | ||
| onError(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error is sent to the client. We should not send either of the two possible error values, as we don't want to send exceptions to clients for the application (it's bad practice that we don't want to encourage) and the other message doesn't make sense to the client.
What we should do instead is slightly unclear, but we can talk about it offline.
ST-DDT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will definitly help detecting usage flaws.
| call.sendMessage(response); | ||
| } else { | ||
| // delay the sendMessage() to onComplete()/onError() | ||
| unaryResponse = response; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this should throw an exception if the server sends multiple responses/overwrites the previous one.
| completed = true; | ||
|
|
||
| if (call.getMethodDescriptor().getType().serverSendsOneMessage()) { | ||
| Throwable error = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error should be logged to the server log.
fixes: #5969