-
Notifications
You must be signed in to change notification settings - Fork 5.6k
fix: descriptor leaking in salt.utils.http.query #68456
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
base: 3007.x
Are you sure you want to change the base?
Conversation
Merge forward 3007.x into master
Merge forward from 3007.x into master
associated with def find(path, *args, **kwargs) in file.py
Wean off tornado.gen.coroutine
…0-27 Merge forward 3007.x into master
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey. There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
twangboy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Could you create a changelog?
|
Is this issue on 3006.x or 3007x too? |
I only caught this bug in 3007.x. @twangboy Added to changelog. Can we add this patch to release in 3007.x? |
|
We usually patch bugs on the earliest supported branch where the bug exists. If this bug exists on 3006.x, please patch it there, then the changes will be merged forward into 3007.x and master branches. |
|
This bug was introduced in #66330. I don't see the same issue in 3006.x releases. |
Ideally the fix would go into the 3007.x branch then. |
What does this PR do?
Wraps the
SyncWrapper(AsyncHTTPClient, …)used insidesalt.utils.http.querywith a context manager so the temporary Tornado IOLoop/socketpair created for each request is always torn down. This stops the salt-minion process from leaking thousands of FDs when repeatedly callinghttp.query.What issues does this PR fix or reference?
Previous Behavior
Each call to
salt.utils.http.queryinstantiated a newSyncWrapper, but never invokedclose(). Every invocation left an IOLoop thread, epoll FD, and socketpair open, so long-lived minions accumulated thousands of FDs and their RSS climbed steadily.New Behavior
http.querynow useswith SyncWrapper(...) as download_client, ensuring the wrapper’sclose()method runs after each request and all resources/FDS are released immediately.Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes