Repository navigation
quic: increasing upstream packet limits - #16856
Conversation
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
danzh2010
left a comment
There was a problem hiding this comment.
Thanks for fixing this! LGTM along aside a nit.
| // PacketsToReadDelegate | ||
| size_t numPacketsExpectedPerEventLoop() override { | ||
| // Just as TCP does 16k per stream, do this for UDP. | ||
| return std::max<size_t>(1, GetNumActiveStreams()) * 16; |
There was a problem hiding this comment.
The magic number 16 is from TCP upstream connection? Can we use a const for both plances?
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: Alyssa Wilk <[email protected]>
| // The old socket is closed in this call. | ||
| setConnectionSocket(std::move(connection_socket)); | ||
| setUpConnectionSocket(); | ||
| setUpConnectionSocket(delegate_.value().get()); |
There was a problem hiding this comment.
It seems like this call to setUpConnectionSocket is setting delegate_ based on the argument pass in to the call, but we read from delegate_ when making that call.
I guess the this assumes that delegate_ is already set by a prior call to setUpConnectionSocket. Can delegate_.value() change?
One thing to consider would be to take in OptRef<PacketsToReadDelegate> delegate as an argument to setUpConnectionSocket in order to avoid the hazard of potentially reading an OptRef that is not set when making this call.
|
|
||
| void EnvoyQuicClientConnection::setUpConnectionSocket() { | ||
| void EnvoyQuicClientConnection::setUpConnectionSocket(PacketsToReadDelegate& delegate) { | ||
| delegate_ = delegate; |
There was a problem hiding this comment.
nit: Consider adding the following ASSERT before this line.
ASSERT(!delegate_.has_value() || &delegate == &delegate_.value().get());
| // TODO(mattklein123): Emit a stat for this. | ||
| } | ||
| size_t numPacketsExpectedPerEventLoop() const override { | ||
| if (delegate_.has_value()) { |
There was a problem hiding this comment.
In what cases is delegate_ not set? It seems like setUpConnectionSocket should be called for all connections, but possibly not early in their life cycle?
There was a problem hiding this comment.
yeah, the connection exists before setUpConnectionSocket but AFIK it's a bug to use or migrate it before it's called.
Can't hurt to make both optref to handle such a bug without crashing though, updated.
Signed-off-by: Alyssa Wilk <[email protected]>
Debugging envoyproxy#16853 it turned out that since we added read limits for packets, TCP downstreams were vastly out-sending UDP upstreams. Changing the upstream limit to be a factor of streams rather than flat rate. Signed-off-by: Alyssa Wilk <[email protected]>
Debugging #16853 it turned out that since we added read limits for packets, TCP downstreams were vastly out-sending UDP upstreams. Changing the upstream limit to be a factor of streams rather than flat rate.
Risk Level: low (H3 only)
Testing: new unit tests
Docs Changes: n/a
Release Notes: n/a