quiche: implement stream idle timeout in codec#17674
quiche: implement stream idle timeout in codec#17674alyssawilk merged 17 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
|
@yanavlasov would you be willing to do first pass on this one? |
| ::Envoy::Http2::Utility::initializeAndValidateOptions( | ||
| envoy::config::core::v3::Http2ProtocolOptions()); | ||
| http2_options.mutable_initial_stream_window_size()->set_value(65535); | ||
| http2_options.mutable_initial_stream_window_size()->set_value(32 * 1024); |
There was a problem hiding this comment.
I think for H/2 the 64K is the minimum. The 32K will be ignored in this case and 64K is applied.
There was a problem hiding this comment.
Good point! In fact, the test still pass with H2. After looking to the log, it seems that before 64k flow control limit kicks in, socket already couldn't send all the data after sending ~32kB. I guess it passes because H2 hit congestion control window with a 32k payload. This is about the same for H3. If the test runs H3 with 64k flow control window, it will be blocked at ~32kB because of CC. As QUICHE needs to ACK packets by itself, not running the event loop of client connection in this test will cause the connection stuck. That's why I uses a smaller flow control window for H3.
To rule out the impact of CC window, I alter the test to still use 64k flow control window for H2 but use 32k for Quic.
|
/wait |
Signed-off-by: Dan Zhang <danzh@google.com>
|
LGTM from me, @alyssawilk for any additional comments |
alyssawilk
left a comment
There was a problem hiding this comment.
Nice! So good to see this gap closed :-)
/wait
| stream_idle_timer_.reset(); | ||
| } | ||
| } | ||
| void destroy() override; |
There was a problem hiding this comment.
generally for overrides we comment the class it's from
// Http::MultiplexedStreamImplBase
| virtual HeaderMapPtr cloneTrailers(const HeaderMap& trailers) PURE; | ||
| virtual void createPendingFlushTimer() PURE; | ||
| void onPendingFlushTimer(); | ||
| void onPendingFlushTimer() override; |
There was a problem hiding this comment.
this would then be moved up with destroy()
| std::chrono::milliseconds stream_idle_timeout_{}; | ||
| Event::TimerPtr stream_idle_timer_; | ||
|
|
||
| protected: |
There was a problem hiding this comment.
ditto on commenting the override.
alternately I don't see a reason to not have it public and group it - your call.
There was a problem hiding this comment.
Done. It is only used by base class. So I prefer keep it as protected.
| } | ||
| } | ||
|
|
||
| bool EnvoyQuicClientStream::hasPendingData() { return BufferedDataBytes() > 0; } |
There was a problem hiding this comment.
Maybe comment how this plays with trailers?
There was a problem hiding this comment.
done. I added comment in server stream to which this interface actually matters.
| const quic::QuicHeaderList& header_list) override; | ||
|
|
||
| // Http::MultiplexedStreamImplBase | ||
| bool hasPendingData() override; |
There was a problem hiding this comment.
should we disable flush timer for client streams as we do for HTTP/2? or maybe since we have separate classes only inherit for the server stream?
There was a problem hiding this comment.
It is disabled via overriding setFlushTimeout() to no-op a few lines above.
hasPendingData() is implemented here just because it is pure method in the base class.
There was a problem hiding this comment.
ah, I missed it as it wasn't part of the diff, my bad!
* main: Fix for fuzz tests failing due to invalid corpus paths (envoyproxy#17767) kafka: fix integration test (envoyproxy#17764) Fix typo in cluster.proto (envoyproxy#17755) cluster manager: add drainConnections() API (envoyproxy#17747) kafka broker filter: move to contrib (envoyproxy#17750) quiche: switch external dependency to github (envoyproxy#17732) quiche: implement stream idle timeout in codec (envoyproxy#17674) Update c-ares to 1.17.2 (envoyproxy#17704) Fix dns resolve fuzz bug (envoyproxy#17107) Remove members that shadow members of the base class (envoyproxy#17713) thrift proxy: missing parts from the previous PR (envoyproxy#17668) thrift-proxy: cleanup ConnectionManager::ActiveRpc (envoyproxy#17734) listener: extra warning for deprecated use_proxy_proto field (envoyproxy#17736) kafka: add support for metadata request in mesh-filter (envoyproxy#17597) upstream: add all host map to priority set for fast host searching (envoyproxy#17290) Remove the support for `hidden_envoy_deprecated_per_filter_config` (envoyproxy#17725) tls: SDS support for private key providers (envoyproxy#16737) bazel: update rules_foreign_cc (envoyproxy#17445) Signed-off-by: Michael Puncel <mpuncel@squareup.com>
Additional Description: refactor out MultiplexedStreamImplBase from http2 codec for code sharing with quic codec
Risk Level: low
Testing: enabled Http2IntegrationTest::CodecStreamIdleTimeout for Http3
Fixes #17654
Part of #16652