-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Implemented H2 stream level buffer accounting. #16218
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
Changes from 1 commit
8c99d4f
44a5e05
6956e95
dbc66ad
65e8206
8abaa72
f7ca7dd
922a222
0295ac9
1644e66
091dc3e
2d5fba4
3e5f947
324dbf9
ee69562
d8f2db7
2e65c5d
f204c8a
c06b5d5
7b32a8d
60ca164
03e7a13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,16 +39,15 @@ class WatermarkBuffer : public OwnedImpl { | |
| void appendSliceForTest(const void* data, uint64_t size) override; | ||
| void appendSliceForTest(absl::string_view data) override; | ||
|
|
||
| void setWatermarks(uint32_t watermark) override { setWatermarks(watermark / 2, watermark); } | ||
| void setWatermarks(uint32_t low_watermark, uint32_t high_watermark); | ||
|
Contributor
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. test/common/buffer/watermark_buffer_test.cc seems to be failing to build because the 2 argument version of setWatermarks is missing, please look into it.
Contributor
Author
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. Done. |
||
| void setWatermarks(uint32_t watermark) override; | ||
| uint32_t highWatermark() const override { return high_watermark_; } | ||
| // Returns true if the high watermark callbacks have been called more recently | ||
| // than the low watermark callbacks. | ||
| bool highWatermarkTriggered() const override { return above_high_watermark_called_; } | ||
|
|
||
| protected: | ||
| virtual void checkHighAndOverflowWatermarks(); | ||
| void checkLowWatermark(); | ||
| virtual void checkLowWatermark(); | ||
|
|
||
| private: | ||
| void commit(uint64_t length, absl::Span<RawSlice> slices, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -365,6 +365,8 @@ class AsyncStreamImpl : public AsyncClient::Stream, | |
| Upstream::ClusterInfoConstSharedPtr clusterInfo() override { return parent_.cluster_; } | ||
| void clearRouteCache() override {} | ||
| uint64_t streamId() const override { return stream_id_; } | ||
| // TODO(kbaichoo): Implement this? | ||
|
Contributor
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 think that some users of async client are filters like the RBAC filter. We should plumb accounts to those eventually. Other users may involve config plane operations which are not associated with clients. Still it may be worth associating with an account owned by the config system, as a way to track memory usage by config plane components.
Contributor
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. Could you change the TODO to something like: Plumb account from owning request filter.
Contributor
Author
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. Updated the comment. |
||
| Buffer::BufferMemoryAccountSharedPtr account() const override { return nullptr; } | ||
| Tracing::Span& activeSpan() override { return active_span_; } | ||
| const Tracing::Config& tracingConfig() override { return tracing_config_; } | ||
| void continueDecoding() override { NOT_IMPLEMENTED_GCOVR_EXCL_LINE; } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,7 +259,8 @@ RequestDecoder& ConnectionManagerImpl::newStream(ResponseEncoder& response_encod | |
| } | ||
|
|
||
| ENVOY_CONN_LOG(debug, "new stream", read_callbacks_->connection()); | ||
| ActiveStreamPtr new_stream(new ActiveStream(*this, response_encoder.getStream().bufferLimit())); | ||
| ActiveStreamPtr new_stream(new ActiveStream(*this, response_encoder.getStream().bufferLimit(), | ||
| response_encoder.getStream().getAccount())); | ||
|
Contributor
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. We could also say that the connection manager is the owner of the account and feed the account directly from the connection manager instead of asking the stream. I think we can remove getAccount() from the stream API if we do this change. See related comment in http2/codec_impl.h setAccount
Contributor
Author
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. See response to comment in http2/codec_impl.h |
||
| new_stream->state_.is_internally_created_ = is_internally_created; | ||
| new_stream->response_encoder_ = &response_encoder; | ||
| new_stream->response_encoder_->getStream().addCallbacks(*new_stream); | ||
|
|
@@ -571,13 +572,14 @@ void ConnectionManagerImpl::RdsRouteConfigUpdateRequester::requestSrdsUpdate( | |
| } | ||
|
|
||
| ConnectionManagerImpl::ActiveStream::ActiveStream(ConnectionManagerImpl& connection_manager, | ||
| uint32_t buffer_limit) | ||
| uint32_t buffer_limit, | ||
| Buffer::BufferMemoryAccountSharedPtr account) | ||
| : connection_manager_(connection_manager), | ||
| stream_id_(connection_manager.random_generator_.random()), | ||
| filter_manager_(*this, connection_manager_.read_callbacks_->connection().dispatcher(), | ||
| connection_manager_.read_callbacks_->connection(), stream_id_, | ||
| connection_manager_.config_.proxy100Continue(), buffer_limit, | ||
| connection_manager_.config_.filterFactory(), | ||
| std::move(account), connection_manager_.config_.proxy100Continue(), | ||
| buffer_limit, connection_manager_.config_.filterFactory(), | ||
| connection_manager_.config_.localReply(), | ||
| connection_manager_.codec_->protocol(), connection_manager_.timeSource(), | ||
| connection_manager_.read_callbacks_->connection().streamInfo().filterState(), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.