Skip to content

Commit

Permalink
udp: deprecate envoy.restart_features.udp_read_normalize_addresses
Browse files Browse the repository at this point in the history
…(#35529)

Commit Message: remove
`envoy.restart_features.udp_read_normalize_addresses` and update change
log.

Risk Level: low
Testing: N/A
Docs Changes: N/A
Release Notes: Yes
Platform Specific Features: N/A
Fixes #30430

---------

Signed-off-by: Dan Zhang <danzh@google.com>
Co-authored-by: Dan Zhang <danzh@google.com>
  • Loading branch information
danzh2010 and danzh1989 authored Aug 2, 2024
1 parent 0970bd3 commit 75622fe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
3 changes: 3 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ removed_config_or_runtime:
- area: stateful_session
change: |
Removed ``envoy.reloadable_features.stateful_session_encode_ttl_in_cookie`` runtime flag and legacy code paths.
- area: udp
change: |
Removed ``envoy.restart_features.udp_read_normalize_addresses`` runtime flag and legacy code paths.
- area: upstream
change: |
Removed runtime flag ``envoy.reloadable_features.upstream_allow_connect_with_2xx`` and legacy code paths.
Expand Down
7 changes: 3 additions & 4 deletions source/common/network/io_socket_handle_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,15 @@ Api::IoCallUint64Result IoSocketHandleImpl::sendmsg(const Buffer::RawSlice* slic
Address::InstanceConstSharedPtr
IoSocketHandleImpl::getOrCreateEnvoyAddressInstance(sockaddr_storage ss, socklen_t ss_len) {
if (recent_received_addresses_ == nullptr) {
return Address::addressFromSockAddrOrDie(ss, ss_len, fd_,
socket_v6only_ || !udp_read_normalize_addresses_);
return Address::addressFromSockAddrOrDie(ss, ss_len, fd_, socket_v6only_);
}
quic::QuicSocketAddress quic_address(ss);
auto it = recent_received_addresses_->Lookup(quic_address);
if (it != recent_received_addresses_->end()) {
return *it->second;
}
Address::InstanceConstSharedPtr new_address = Address::addressFromSockAddrOrDie(
ss, ss_len, fd_, socket_v6only_ || !udp_read_normalize_addresses_);
Address::InstanceConstSharedPtr new_address =
Address::addressFromSockAddrOrDie(ss, ss_len, fd_, socket_v6only_);
recent_received_addresses_->Insert(
quic_address, std::make_unique<Address::InstanceConstSharedPtr>(new_address));
return new_address;
Expand Down
4 changes: 0 additions & 4 deletions source/common/network/io_socket_handle_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class IoSocketHandleImpl : public IoSocketHandleBaseImpl {
absl::optional<int> domain = absl::nullopt,
size_t address_cache_max_capacity = 0)
: IoSocketHandleBaseImpl(fd, socket_v6only, domain),
udp_read_normalize_addresses_(
Runtime::runtimeFeatureEnabled("envoy.restart_features.udp_read_normalize_addresses")),
receive_ecn_(Runtime::runtimeFeatureEnabled("envoy.reloadable_features.quic_receive_ecn")) {
if (address_cache_max_capacity > 0) {
recent_received_addresses_ =
Expand Down Expand Up @@ -108,8 +106,6 @@ class IoSocketHandleImpl : public IoSocketHandleBaseImpl {
const size_t cmsg_space_{CMSG_SPACE(sizeof(int)) + CMSG_SPACE(sizeof(struct in_pktinfo)) +
CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(uint16_t))};

const bool udp_read_normalize_addresses_;

// Latches a copy of the runtime feature "envoy.reloadable_features.quic_receive_ecn".
const bool receive_ecn_;

Expand Down
1 change: 0 additions & 1 deletion source/common/runtime/runtime_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ RUNTIME_GUARD(envoy_reloadable_features_xdstp_path_avoid_colon_encoding);
RUNTIME_GUARD(envoy_restart_features_allow_client_socket_creation_failure);
RUNTIME_GUARD(envoy_restart_features_allow_slot_destroy_on_worker_threads);
RUNTIME_GUARD(envoy_restart_features_quic_handle_certs_with_shared_tls_code);
RUNTIME_GUARD(envoy_restart_features_udp_read_normalize_addresses);
RUNTIME_GUARD(envoy_restart_features_use_fast_protobuf_hash);

// Begin false flags. Most of them should come with a TODO to flip true.
Expand Down
11 changes: 2 additions & 9 deletions test/integration/quic_http_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2258,15 +2258,8 @@ TEST_P(QuicHttpIntegrationSPATest, UsesPreferredAddressDualStack) {
ASSERT_TRUE(response->complete());

EXPECT_EQ("127.0.0.2", quic_connection_->peer_address().host().ToString());
if (Runtime::runtimeFeatureEnabled("envoy.restart_features.udp_read_normalize_addresses")) {
test_server_->waitForCounterGe(
"listener.[__]_0.quic.connection.num_packets_rx_on_preferred_address", 2u);
} else {
EXPECT_EQ(
0u,
test_server_->counter("listener.[__]_0.quic.connection.num_packets_rx_on_preferred_address")
->value());
}
test_server_->waitForCounterGe(
"listener.[__]_0.quic.connection.num_packets_rx_on_preferred_address", 2u);
}

TEST_P(QuicHttpIntegrationTest, PreferredAddressDroppedByIncompatibleListenerFilter) {
Expand Down

0 comments on commit 75622fe

Please sign in to comment.