-
Notifications
You must be signed in to change notification settings - Fork 274
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
Close the request if 100 continue failed #2793
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2793 +/- ##
=============================================
- Coverage 64.24% 31.91% -32.33%
+ Complexity 10398 5375 -5023
=============================================
Files 840 840
Lines 71755 71955 +200
Branches 8611 8652 +41
=============================================
- Hits 46099 22967 -23132
- Misses 23004 47211 +24207
+ Partials 2652 1777 -875 ☔ View full report in Codecov by Sentry. |
ca4cff3
to
428a12d
Compare
428a12d
to
e9af6de
Compare
e9af6de
to
381de82
Compare
ambry-rest/src/main/java/com/github/ambry/rest/NettyMessageProcessor.java
Outdated
Show resolved
Hide resolved
@@ -1111,7 +1110,12 @@ public void operationComplete(ChannelFuture future) { | |||
// in this case there is nothing more to write. | |||
if (!writeFuture.isDone()) { | |||
writeFuture.setSuccess(); | |||
completeRequest(!HttpUtil.isKeepAlive(finalResponseMetadata), false); | |||
//Don't close the request when we see 100-continue in EXPECT header. |
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.
completeRequest(!HttpUtil.isKeepAlive(finalResponseMetadata), false, !RestUtils.isPutRequestAndExpectContinue(request));
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.
Sure, updated.
metrics.requestProcessingError.inc(); | ||
if (requestInfo != null) { | ||
onProcessingFailure(requestInfo.restRequest, requestInfo.restResponseChannel, e); | ||
onProcessingFailure(requestInfo.restRequest, requestInfo.restResponseChannel, (Exception) e); |
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.
you can't convert this to an Exception if e is not an instance of Exception. you can probably add a line in the previous if statement to convert this throwable to exception. something like this
if (!(e instanceof Exception)) {
metrics.requestProcessingThrowableError.inc();
if (requestInfo != null) {
logger.error("Throwable only while processing the requests" + requestInfo.restRequest, e);
} else {
logger.error("Throwable only while processing the requests", e);
}
e = new Exception(e);
}
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.
you are right, fixed it.
8f959f4
to
5b8c419
Compare
No description provided.