-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Changes from 2 commits
4787ccc
f64b5a4
4b99378
f08db82
6c54490
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -610,8 +610,7 @@ void setListener(ServerStreamListener listener) { | |
* Like {@link ServerCall#close(Status, Metadata)}, but thread-safe for internal use. | ||
*/ | ||
private void internalClose() { | ||
// TODO(ejona86): this is not thread-safe :) | ||
stream.close(Status.UNKNOWN, new Metadata()); | ||
stream.cancel(Status.INTERNAL); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
@Override | ||
|
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()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now calling 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 |
||
assertNull(responseRef.get()); | ||
} | ||
} |
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 status is stored internally in gRPC, but won't actually be exposed anywhere on server-side. We should probably go ahead and log it here.
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.
ok. which level? Is
SEVERE
the correct level? I have added withWARN
. Let me know if needs to be changed.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.
WARNING seems good. SEVERE seems a bit too much, because we were able to recover.