quic: test fast-fail if secrets not loaded when create quic connection#18705
quic: test fast-fail if secrets not loaded when create quic connection#18705ggreenway merged 4 commits intoenvoyproxy:mainfrom
Conversation
|
Do you have any context for this change? Also, please fill out the required fields in the PR description. For an explanation of how to fill out the fields, please see the relevant section /wait |
|
/wait |
|
@RyanTheOptimist because the function createQuicNetworkConnection() (https://github.com/envoyproxy/envoy/blob/main/source/common/quic/client_connection_factory_impl.cc#L65) would return nullptr, so need this fix to avoid invalid reference. |
It looks like quic upstream would reference nullptr if using SDS without this fix. Could you please add a regression test for this fix? |
I'll do it :) |
|
/wait |
|
It seems there are fast-fail to check if secret is loaded (https://github.com/envoyproxy/envoy/blob/main/source/common/http/http3/conn_pool.cc#L88), so if the secrets will not change to empty again, and the createQuicNetworkConnection will not return nullptr. I wonder if it's necessary to double check in createQuicNetworkConnection. If do it, it is necessary to confirm the return value of createQuicNetworkConnection out of defense. Although it's necessary to add a test for fast-fail if secrets not loaded, and I'd like to do it:) |
e148a6a to
3f4bf3a
Compare
RyanTheOptimist
left a comment
There was a problem hiding this comment.
Thanks for the test!
There was a problem hiding this comment.
Does this object leak, or does the dispatcher end up returning it at some point? If the latter, please add a short comment which says that.
There was a problem hiding this comment.
nit: Please use ConnectionPool::InstancePtr instead of auto (assuming that's the right type).
b2d2a25 to
73d3b2f
Compare
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
|
@RyanTheOptimist updated. Errors in CI don't appear to be related to this PR. |
So to clarify, is the new test testing this existing |
I had two comments from yesterday that don't seem to be address. Have they been address? A note for the future: force pushes breaks the reviewing flow, so please avoid doing so while iterating on the PR. We end up squashing the commits on merge anyways, so it leaving the commits up doesn't matter. |
|
/retest |
|
Retrying Azure Pipelines: |
Both have been fixed, add comment for suspected leak and change auto to specific type. I used to keep the commit log clean :) But thanks for the advice, I'll follow it next time. |
New testing code is for the existing |
Interesting. I wonder what would happen if you duplicated your new tests, but changed: |
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
|
@RyanTheOptimist Updated. Actually we can't manipulate isReady(), because it's triggered by secrets change. But we can't precisely make the secret change after fast-fail but before createQuicNetworkConnection. So I create a mock QuicClientTransportSocketFactory and to achive the goal by changing the return value of method ssl_context :) |
|
/retest |
|
Retrying Azure Pipelines: |
RyanTheOptimist
left a comment
There was a problem hiding this comment.
This looks good to me. @danzh2010 what do you think?
|
/approve-from envoyproxy/senior-maintainers |
|
/assign-from envoyproxy/senior-maintainers |
|
envoyproxy/senior-maintainers assignee is @ggreenway |
| source_address, quic_stat_names, scope); | ||
| if (data.connection_ == nullptr) { | ||
| ENVOY_LOG_TO_LOGGER( | ||
| Envoy::Logger::Registry::getLog(Envoy::Logger::Id::pool), warn, |
There was a problem hiding this comment.
Is warn going to be too much output in the log? I presume if this happens once, it'll probably happen for every connection attempt. Maybe use ENVOY_LOG_PERIODIC_TO_LOGGER or ENVOY_LOG_EVERY_POW_2_TO_LOGGER?
Is there any failure metric that increases in this case?
There was a problem hiding this comment.
@ggreenway updated to ENVOY_LOG_EVERY_POW_2_TO_LOGGER.
As for failure metric, there seems to be no metric to indicate the failure of quic connection creation. From my research, even for HTTP 1/2, there is only a metric bind_errors_ which is used to indicate the bind error when failed to create client network connection.
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
22feb33
Commit Message: quic: test fast-fail if secrets not loaded when create quic connection
Additional Description: N/A
Risk Level: Low
Testing: N/A
Docs Changes: N/A