[go: nahoru, domu]

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

Close the request if 100 continue failed #2793

Merged
merged 3 commits into from
May 30, 2024

Conversation

SophieGuo410
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link
codecov-commenter commented May 28, 2024

Codecov Report

Attention: Patch coverage is 24.00000% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 31.91%. Comparing base (52ba813) to head (5b8c419).
Report is 18 commits behind head on master.

Files Patch % Lines
...github/ambry/rest/AsyncRequestResponseHandler.java 0.00% 8 Missing ⚠️
...va/com/github/ambry/rest/NettyResponseChannel.java 30.00% 3 Missing and 4 partials ⚠️
...a/com/github/ambry/rest/NettyMessageProcessor.java 33.33% 0 Missing and 2 partials ⚠️
...src/main/java/com/github/ambry/rest/RestUtils.java 0.00% 0 Missing and 1 partial ⚠️
...com/github/ambry/frontend/NamedBlobPutHandler.java 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@SophieGuo410 SophieGuo410 force-pushed the Branch_fix_issue branch 4 times, most recently from ca4cff3 to 428a12d Compare May 29, 2024 05:14
@SophieGuo410 SophieGuo410 marked this pull request as ready for review May 29, 2024 05:45
@@ -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.
Copy link
Collaborator

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));

Copy link
Contributor Author

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);
Copy link
Collaborator

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);
          }

Copy link
Contributor Author

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.

@SophieGuo410 SophieGuo410 merged commit 0194ce7 into linkedin:master May 30, 2024
5 checks passed
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.

None yet

3 participants