-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Allow multiplexed upstream servers to half close the stream before the downstream #34461
Merged
yanavlasov
merged 37 commits into
envoyproxy:main
from
yanavlasov:allow-upstream-half-close
Aug 28, 2024
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
7263c53
Allow multiplexed upstream servers to half close the stream before th…
yanavlasov fd17760
Address comments
yanavlasov 723ed65
Merge branch 'main' into allow-upstream-half-close
yanavlasov 1d8172c
Address comments
yanavlasov 3ba7cc4
Clarify comment
yanavlasov 6133efc
Reuse isHalfCloseEnabled callback
yanavlasov fcf2a76
Add stopDecoding
yanavlasov f24bc34
Merge branch 'main' into allow-upstream-half-close
yanavlasov 0e881dc
Merge branch 'main' into allow-upstream-half-close
yanavlasov b7b746f
Fixing tests
yanavlasov af60f0b
Address post merge test failures
yanavlasov 01ae68b
Merge branch 'main' into allow-upstream-half-close
yanavlasov 1f269a4
Post merge fix
yanavlasov 1b961df
Fix gcc build error
yanavlasov 8ae88a0
WiP
yanavlasov d8aabba
Merge branch 'main' into allow-upstream-half-close
yanavlasov 2166fcb
Post merge fixes
yanavlasov e2deca2
WiP
yanavlasov 9e9428f
Make ending filters in the middle of the filter chain work. p1
yanavlasov 71ce1f0
Make encoding filters in the middle of the filter chain work. p2
yanavlasov 68c807e
Update comments
yanavlasov 9c308ba
Merge branch 'main' into allow-upstream-half-close
yanavlasov 2d8cb15
post merge fixes
yanavlasov e1c00d0
Update comment
yanavlasov 018a3e4
Update comments
yanavlasov 9a692f3
Address comments
yanavlasov bd30f81
Merge branch 'main' into allow-upstream-half-close
yanavlasov b9948ab
Post merge fix
yanavlasov e224738
Update comment
yanavlasov e4ae6b4
Merge branch 'main' into allow-upstream-half-close
yanavlasov d5320da
Fix docs
yanavlasov b804cb5
Disable upstream filter tests
yanavlasov 4b305d9
Add coverage
yanavlasov 9155e49
Address comments
yanavlasov 49b6162
Merge branch 'main' into allow-upstream-half-close
yanavlasov c02ac47
Add asserts
yanavlasov d965ff6
Merge branch 'main' into allow-upstream-half-close
yanavlasov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,7 +283,7 @@ class ConnectionManagerImpl : Logger::Loggable<Logger::Id::http>, | |
OptRef<const Tracing::Config> tracingConfig() const override; | ||
const ScopeTrackedObject& scope() override; | ||
OptRef<DownstreamStreamFilterCallbacks> downstreamCallbacks() override { return *this; } | ||
bool isHalfCloseEnabled() override { return false; } | ||
bool isHalfCloseEnabled() override { return connection_manager_.allow_upstream_half_close_; } | ||
|
||
// DownstreamStreamFilterCallbacks | ||
void setRoute(Router::RouteConstSharedPtr route) override; | ||
|
@@ -641,6 +641,18 @@ class ConnectionManagerImpl : Logger::Loggable<Logger::Id::http>, | |
uint32_t requests_during_dispatch_count_{0}; | ||
const uint32_t max_requests_during_dispatch_{UINT32_MAX}; | ||
Event::SchedulableCallbackPtr deferred_request_processing_callback_; | ||
|
||
// If independent half-close is enabled and the upstream protocol is either HTTP/2 or HTTP/3 | ||
// protocols the stream is destroyed after both request and response are complete i.e. reach their | ||
// respective end-of-stream, by receiving trailers or the header/body with end-stream set in both | ||
// directions AND response has success (2xx) status code. | ||
// | ||
// For HTTP/1 upstream protocol or if independent half-close is disabled the stream is destroyed | ||
// when the response is complete and reaches its end-of-stream, i.e. when trailers or the response | ||
// header/body with end-stream set are received, even if the request has not yet completed. If | ||
// request was incomplete at response completion, the stream is reset. | ||
|
||
const bool allow_upstream_half_close_{}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we have half close behavior commented anywhere? comment link to it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added docs and more comments. |
||
}; | ||
|
||
} // namespace Http | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Great docs!