Skip to content

Conversation

weichou1229
Copy link
Member

@weichou1229 weichou1229 commented Aug 10, 2021

Close: #268

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

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?

  • Yes
  • No

New Imports

  • Yes
  • No

Specific Instructions

Are there any specific instructions or things that should be known prior to reviewing?

Other information

@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2021

Codecov Report

Merging #267 (9d22598) into main (2a375e7) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a375e7...9d22598. Read the comment docs.

Copy link
Member

@lenny-goodell lenny-goodell left a 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

@weichou1229 weichou1229 changed the title feat: Remove Http server timeout settings feat: Use Http Request timeout handler Aug 11, 2021
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>
@weichou1229 weichou1229 force-pushed the rm-req-timeout-setting branch from 9d22598 to a06c5a1 Compare August 11, 2021 01:59
@weichou1229
Copy link
Member Author

Issue created #268

return false
}

b.router.Use(func(next http.Handler) http.Handler {
Copy link
Member

Choose a reason for hiding this comment

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

Nice!!

Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

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

LGTM

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.

REST endpoints do not gracefully handle request timeout configured by bootstrap
3 participants