Skip to content

Conversation

@ran-su
Copy link
Member

@ran-su ran-su commented Oct 17, 2019

fixes: #5969

@ran-su ran-su requested review from creamsoup and ejona86 October 17, 2019 23:54
Copy link
Contributor

@creamsoup creamsoup left a 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);
Copy link
Member

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.

Copy link
Contributor

@ST-DDT ST-DDT left a 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;
Copy link
Contributor

@ST-DDT ST-DDT Oct 26, 2019

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;
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

async server: need to ignore unary response msg if status is not OK

4 participants