Skip to content

Commit

Permalink
support backoff between retries in udp_proxy (#37912)
Browse files Browse the repository at this point in the history
Commit Message: support backoff between retries in udp_proxy
Additional Description: This feature also fixes a bug in the retry
mechanism in udp proxy in the following situation:
1. We are tunneling UDP over HTTP.
2. A new stream is created on existing upstream connection
(multiplexing) and waiting for response headers.
3. The upstream connection is closed.
4. During the close process, all streams created on this connection will
be reset.
5. The udp_proxy receives a callback on the stream reset.
6. They retry to connect.
7. The closed connection is picked as it is still in the connection pool
(we are still in the process of the close).
8. The new stream that is created on the second attempt will be reset
immediately.
9. The same process will happen (step 5 - step 8) until we reach the
max_connect_attepts.
10. This means that we are doing only one real attempt in this
situation.

Risk Level: medium
Testing: unit tests, integration tests
Docs Changes: added
Release Notes: added

---------

Signed-off-by: Issa Abu Kalbein <[email protected]>
Co-authored-by: Issa Abu Kalbein <[email protected]>

Mirrored from https://github.com/envoyproxy/envoy @ 24254316bab17cb48d48f88297e91a3dee739f58
  • Loading branch information
update-envoy[bot] committed Jan 8, 2025
1 parent 965e86f commit f5611a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions envoy/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package envoy.extensions.filters.udp.udp_proxy.v3;

import "envoy/config/accesslog/v3/accesslog.proto";
import "envoy/config/core/v3/backoff.proto";
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/config_source.proto";
import "envoy/config/core/v3/udp_socket_config.proto";
Expand Down Expand Up @@ -91,6 +92,9 @@ message UdpProxyConfig {
// The maximum number of unsuccessful connection attempts that will be made before giving up.
// If the parameter is not specified, 1 connection attempt will be made.
google.protobuf.UInt32Value max_connect_attempts = 1;

// Sets the backoff strategy. If not set, the retries are performed without backoff.
config.core.v3.BackoffStrategy backoff_options = 2;
}

// The hostname to send in the synthesized CONNECT headers to the upstream proxy.
Expand Down

0 comments on commit f5611a9

Please sign in to comment.