-
Notifications
You must be signed in to change notification settings - Fork 54
feat: Use Http Request timeout handler #267
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
feat: Use Http Request timeout handler #267
Conversation
Codecov Report
@@ Coverage Diff @@
## main #267 +/- ##
=======================================
Coverage 58.90% 58.90%
=======================================
Files 12 12
Lines 786 786
=======================================
Hits 463 463
Misses 309 309
Partials 14 14 Continue to review full report at Codecov.
|
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.
Please create related issue describing why this is needed
To handler the Request timeout properly, we can use TimeoutHandler to provide more meaningful error message and status code, and we also need to remove the timeout settings from the Http server to make the timeout handler works. Close edgexfoundry#268 Signed-off-by: weichou <weichou1229@gmail.com>
9d22598
to
a06c5a1
Compare
Issue created #268 |
return false | ||
} | ||
|
||
b.router.Use(func(next http.Handler) http.Handler { |
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.
Nice!!
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.
LGTM
Close: #268
PR Checklist
Please check if your PR fulfills the following requirements:
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-bootstrap/blob/master/.github/Contributing.md.
What is the current behavior?
Http server close the conn when request timeout and didn't return any useful message.
Issue Number: #268
What is the new behavior?
Since we can use timeout handler to provide more meaningful error message, we need to remove the timeout settings from the Http server to make the timeout handler works.
Does this PR introduce a breaking change?
New Imports
Specific Instructions
Are there any specific instructions or things that should be known prior to reviewing?
Other information