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

Improve timeout support for HTTP #1456

Merged
merged 11 commits into from
Apr 2, 2021
Merged

Improve timeout support for HTTP #1456

merged 11 commits into from
Apr 2, 2021

Conversation

bondolo
Copy link
Contributor

@bondolo bondolo commented Mar 25, 2021

Motivation:
Some uses of the HTTP API require progress or completion within specified time limits.

Modifications:
New or enhanced filters are provided for client and server to manage timeout events.
Existing client filter TimeoutHttpRequesterFilter is enhanced to support additional
timeout options for the entire HTTP request/response transaction. A new server filter
TimeoutHttpServiceFilter is provided for managing timeouts by services.

Result:
HTTP API provides request/response transaction timeout capabilities

@bondolo bondolo self-assigned this Mar 25, 2021
@tkountis
Copy link
Contributor

Minor comments.

@bondolo bondolo force-pushed the timeout-http branch 2 times, most recently from 2f6e0c9 to c690727 Compare March 30, 2021 21:02
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

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

Couple polishing comments and ship it. Can't wait to use these enhancements instead of a custom filters

bondolo added 10 commits April 1, 2021 11:15
Motivation:
Some uses of the HTTP API require progress or completion within specified time limits.

Modifications:
New or enhanced filters are proivded for client and server to manage timeout events.
Existing client filter `TimeoutHttpRequesterFilter` is enhanced to support additional
timeout options for the entire HTTP request/response transaction. A new server filter
`TimeoutHttpServiceFilter` is provided for managing timeouts by services.

Result:
HTTP API provides request/response transaction timeout capabilities
Also adds more details about AsyncContext use with defaultTimeout()
Add support for fullRequestResponse timeout to ServiceFilter
More common code in filters
Move simpleDurationTimeout() to TimeoutFromRequest
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

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

Let's merge this PR after simpleDurationTimeout is made pkg-private. The PR looks correct from the implementation and API point of view. Code sharing can be done in a follow-up PR, if ever necessary.
Thank you for the great improvement!

@bondolo bondolo merged commit a953261 into apple:main Apr 2, 2021
@bondolo bondolo deleted the timeout-http branch April 2, 2021 00:28
idelpivnitskiy pushed a commit to idelpivnitskiy/servicetalk that referenced this pull request Apr 2, 2021
Motivation:
Some uses of the HTTP API require progress or completion within specified time limits.

Modifications:
New or enhanced filters are proivded for client and server to manage timeout events.
Existing client filter `TimeoutHttpRequesterFilter` is enhanced to support additional
timeout options for the entire HTTP request/response transaction. A new server filter
`TimeoutHttpServiceFilter` is provided for managing timeouts by services.

Result:
HTTP API provides request/response transaction timeout capabilities
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.

4 participants