8000 Fix various goroutine leaks and open file descriptor leak by fosterseth · Pull Request #459 · ansible/receptor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix various goroutine leaks and open file descriptor leak #459

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

Merged
merged 2 commits into from
Oct 29, 2021

Conversation

fosterseth
Copy link
Member
@fosterseth fosterseth commented Oct 27, 2021

This does a lot of things, but the main problem was go routine leaks surrounding our pub/sub broker. I've made changes to make sure we are guaranteed to exit those goroutines when we shutdown a connection.

The other big change is that we explicitly close the quic connection after use (on the dialer side).

err = conn.(interface{ CloseConnection() error }).CloseConnection()

conn.Close() only shuts down the write side of the quic stream. The underlying connection was hanging around, and with it lots of goroutines.

There might still be an avenue for connection leaks -- if the dialer closes a connection but the server never gets that close signal, then it might remain open indefinitely. We may need to find a way to auto-close a connection if it has been inactive for some period of time.

@fosterseth fosterseth mentioned this pull request Oct 27, 2021
@fosterseth fosterseth changed the title Fix various goroutine leaks Fix various goroutine leaks and open file descriptor leak Oct 27, 2021
Ensure exit for GetResults
Introduce a way to close the quic connection (as opposed to closing
the stream)
@fosterseth fosterseth force-pushed the fix_goroutine_leak_1.1 branch from d7394b8 to b18b8ad Compare October 28, 2021 18:10
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.

2 participants
0