envoy icon indicating copy to clipboard operation
envoy copied to clipboard

udp: avoid keeping UDP sockets unconnected

Open zhxie opened this issue 2 years ago • 7 comments

Signed-off-by: Xie Zhihao [email protected]

Commit Message: udp: avoid keeping UDP sockets unconnected Additional Description:

The patch fixes keeping UDP sockets unconnected and avoids exhausting UDP ports according to the issue.

# Previous
UNCONN  0       0                     0.0.0.0:10000          0.0.0.0:*       users:(("envoy-static",pid=875931,fd=17))
ESTAB   0       0                   127.0.0.1:52082        127.0.0.1:10000   users:(("nc",pid=875966,fd=3))
UNCONN  0       0                     0.0.0.0:56624          0.0.0.0:*       users:(("envoy-static",pid=875931,fd=16))
ESTAB   0       0                   127.0.0.1:5005         127.0.0.1:56624   users:(("nc",pid=875954,fd=3))

# Current
UNCONN  0       0                     0.0.0.0:10000          0.0.0.0:*       users:(("envoy-static",pid=884658,fd=17))
ESTAB   0       0                   127.0.0.1:47803        127.0.0.1:10000   users:(("nc",pid=884693,fd=3))
ESTAB   0       0                   127.0.0.1:53490        127.0.0.1:5005    users:(("envoy-static",pid=884658,fd=16))
ESTAB   0       0                   127.0.0.1:5005         127.0.0.1:53490   users:(("nc",pid=884681,fd=3))

Since use_original_src_ip is conflict with connect. When use_original_src_ip is set, connect will not take place.

Risk Level: Low Testing: manual (have no idea to test with CI) Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.udp_proxy_connect Fixes #21712

zhxie avatar Sep 15 '22 07:09 zhxie

I think it will be better to add a runtime guard.

zhxie avatar Sep 19 '22 02:09 zhxie

LGTM, except adding more comments in the code

@RyanTheOptimist for maintainer review

soulxu avatar Sep 19 '22 02:09 soulxu

Looks like this needs a main merge.

RyanTheOptimist avatar Sep 21 '22 17:09 RyanTheOptimist

/assign @mattklein123

RyanTheOptimist avatar Sep 21 '22 17:09 RyanTheOptimist

/wait

RyanTheOptimist avatar Sep 21 '22 17:09 RyanTheOptimist

/retest

soulxu avatar Sep 23 '22 03:09 soulxu

Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/23121#issuecomment-1255759560 was created by @soulxu.

see: more, trace.

/retest

ci fixed

soulxu avatar Sep 23 '22 10:09 soulxu

Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/23121#issuecomment-1256033340 was created by @soulxu.

see: more, trace.