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

goroutines limit 8128 exceeded on Windows and unit test failed #5261

Closed
luolanzone opened this issue Jul 18, 2023 · 4 comments · Fixed by #5294
Closed

goroutines limit 8128 exceeded on Windows and unit test failed #5261

luolanzone opened this issue Jul 18, 2023 · 4 comments · Fixed by #5294
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@luolanzone
Copy link
Contributor

luolanzone commented Jul 18, 2023

The following errors happens occasionally, and Windows unit test will fail.

I0717 14:02:36.622835    4296 ofctrl_bridge.go:297] OFSwitch is connected: 01:02:03:04:05:06:07:08
race: limit on 8128 simultaneously alive goroutines is exceeded, dying

A build failure: https://github.com/antrea-io/antrea/actions/runs/5576066018/attempts/2?pr=523

@luolanzone luolanzone added the kind/bug Categorizes issue or PR as related to a bug. label Jul 18, 2023
@tnqn
Copy link
Member

tnqn commented Jul 18, 2023

It may indicate there is goroutine leak, hope it's only in test code.

@shi0rik0
Copy link
Contributor

I think I figure out the reason of this failure. The TestConcurrentCreateGroups in pkg/ovs/openflow/ofctrl_bridge_test.go creates 8000 goroutines, and "race detector on Windows has limit of 8192 simultaneously alive goroutines." Although 8000 < 8192, "by default the command go test runs in parallel tests for different packages, and default is the number of CPUs available" (ref: https://stackoverflow.com/a/58987438 ), so it's still possible that the total number of goroutines exceed the limits of 8192.

A workaround is setting 8000 to a smaller value, or we can just safely ignore such failure.

@tnqn @luolanzone

@luolanzone
Copy link
Contributor Author

@ceclinux I suppose it's Ok to decrease the number?

@luolanzone
Copy link
Contributor Author

I synced with @ceclinux , @shi0rik0 you can go ahead to adjust the value to a smaller one, 7000 should also work. Thanks.

shi0rik0 added a commit to shi0rik0/antrea that referenced this issue Jul 21, 2023
Currently the number of goroutines created in TestConcurrentCreateGroups is too
large that sometimes the limit of 8192 goroutines of the race detector on
Windows is exceeded. Reducing the number of goroutines may relieve the problem.

Fixes antrea-io#5261.

Signed-off-by: shi0rik0 <anguuan@outlook.com>
antoninbas pushed a commit that referenced this issue Jul 21, 2023
Currently the number of goroutines created in TestConcurrentCreateGroups is so
large that sometimes the limit of 8192 goroutines of the race detector on
Windows is exceeded. Reducing the number of goroutines may resolve the problem.

Fixes #5261.

Signed-off-by: shi0rik0 <anguuan@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants