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

core: change serverimpl,servercallimpl's internalclose to cancel stream #4038

Merged
merged 5 commits into from
Feb 22, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: fixed MoreInProcessTest
Signed-off-by: Rama <[email protected]>
ramaraochavali committed Feb 4, 2018
commit f64b5a47cfbd7e24ac2e8ed5824d19839b284d0c
Original file line number Diff line number Diff line change
@@ -247,7 +247,7 @@ public void onCompleted() {
.onNext(StreamingInputCallRequest.getDefaultInstance());

assertTrue(finishLatch.await(900, TimeUnit.MILLISECONDS));
assertEquals(Status.UNKNOWN, Status.fromThrowable(throwableRef.get()));
assertEquals(Status.CANCELLED.getCode(), Status.fromThrowable(throwableRef.get()).getCode());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now calling serverStream.cancel() will propagate a CANCEL HTTP/2 error to the remote. It'd probably be better if it was INTERNAL_ERROR, which will get mapped to a INTERNAL grpc status code. That way the client would get a signal that it shouldn't retry.

I think it'd be fair to map gRPC's DEADLINE_EXCEEDED and CANCELLED error codes to HTTP/2's CANCEL, and everything else map to HTTP/2's INTERNAL_ERROR. Right now we use DEADLINE_EXCEEDED for when deadline expires. That mapping could be in NettyServerHandler.cancelStream().

assertNull(responseRef.get());
}
}