Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: socket is leak on IPv6 testbed #4104

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

wenyingd
Copy link
Contributor

@wenyingd wenyingd commented Aug 11, 2022

Agent sends IPv6 Gratuitous NDP packet on each Pod to broadcast its
address. The socket is not closed after sending packet, which introduces
socket leak.

To resolve the issue, adding a defer function to close the socket after
writing the packet into the connection.

Fixes #4086

Signed-off-by: wenyingd wenyingd@vmware.com

@wenyingd
Copy link
Contributor Author

/test-ipv6-only-e2e
/test-ipv6-e2e

@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #4104 (916eab3) into main (173ef52) will increase coverage by 3.13%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4104      +/-   ##
==========================================
+ Coverage   64.42%   67.56%   +3.13%     
==========================================
  Files         299      299              
  Lines       45448    45450       +2     
==========================================
+ Hits        29281    30708    +1427     
+ Misses      13799    12355    -1444     
- Partials     2368     2387      +19     
Flag Coverage Δ
e2e-tests 40.21% <0.00%> (?)
integration-tests 35.54% <0.00%> (+0.06%) ⬆️
kind-e2e-tests 50.36% <0.00%> (+6.57%) ⬆️
unit-tests 44.29% <0.00%> (+0.02%) ⬆️
Impacted Files Coverage Δ
pkg/agent/util/ndp/ndp.go 0.00% <0.00%> (ø)
pkg/controller/networkpolicy/tier.go 16.66% <0.00%> (-38.34%) ⬇️
pkg/ipfix/ipfix_process.go 81.25% <0.00%> (-18.75%) ⬇️
...lticluster/commonarea/resourceimport_controller.go 76.27% <0.00%> (ø)
pkg/agent/controller/networkpolicy/cache.go 89.38% <0.00%> (+0.35%) ⬆️
pkg/ovs/openflow/ofctrl_bridge.go 75.92% <0.00%> (+0.39%) ⬆️
pkg/ipam/ipallocator/allocator.go 88.14% <0.00%> (+0.51%) ⬆️
pkg/controller/ipam/validate.go 80.32% <0.00%> (+0.54%) ⬆️
pkg/agent/openflow/client.go 69.64% <0.00%> (+0.79%) ⬆️
... and 54 more

@wenyingd wenyingd changed the title IPv6 socket leak Bugfix: socket is leak on IPv6 testbed Aug 11, 2022
Agent sends IPv6 Gratuitous NDP packet on each Pod to broadcast its
address. The socket is not closed after sending packet, which introduces
socket leak.

To resolve the issue, adding a defer function to close the socket after
writing the packet into the connection.

Signed-off-by: wenyingd <wenyingd@vmware.com>
@wenyingd
Copy link
Contributor Author

/test-all
/test-ipv6-all
/test-ipv6-only-all

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenyingd
Copy link
Contributor Author

/test-ipv6-networkpolicy
/test-ipv6-only-networkpolicy

@wenyingd
Copy link
Contributor Author

/test-flexible-ipam-e2e

@wenyingd wenyingd requested a review from gran-vmv August 15, 2022 02:32
@tnqn tnqn merged commit 727953e into antrea-io:main Aug 15, 2022
@tnqn tnqn added this to the Antrea v1.8 release milestone Aug 15, 2022
@wenyingd wenyingd deleted the ipv6_socket_leak branch August 15, 2022 03:29
heanlan pushed a commit to heanlan/antrea that referenced this pull request Mar 29, 2023
Agent sends IPv6 Gratuitous NDP packet on each Pod to broadcast its
address. The socket is not closed after sending packet, which introduces
socket leak.

To resolve the issue, adding a defer function to close the socket after
writing the packet into the connection.

Signed-off-by: wenyingd <wenyingd@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e test "TestBatchCreatePods" is Flaky
3 participants