Skip to content

Conversation

@vitalvas
Copy link

@vitalvas vitalvas commented Nov 12, 2025

What does this PR do?

Wraps the SyncWrapper(AsyncHTTPClient, …) used inside salt.utils.http.query with 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 calling http.query.

What issues does this PR fix or reference?

Previous Behavior

Each call to salt.utils.http.query instantiated a new SyncWrapper, but never invoked close(). 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.query now uses with SyncWrapper(...) as download_client, ensuring the wrapper’s close() 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

samcole8 and others added 30 commits February 21, 2025 02:32
associated with def find(path, *args, **kwargs) in file.py
@vitalvas vitalvas requested a review from a team as a code owner November 12, 2025 17:24
@welcome
Copy link

welcome bot commented Nov 12, 2025

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.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

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.
If you have additional questions, email us at [email protected]. We're glad you've joined our community and look forward to doing awesome things with you!

Copy link
Contributor

@twangboy twangboy left a 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?

@dwoz
Copy link
Contributor

dwoz commented Nov 14, 2025

Is this issue on 3006.x or 3007x too?

@vitalvas
Copy link
Author

vitalvas commented Nov 14, 2025

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?

@vitalvas vitalvas requested a review from twangboy November 14, 2025 16:16
@twangboy
Copy link
Contributor

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.

@vitalvas
Copy link
Author

This bug was introduced in #66330.

I don't see the same issue in 3006.x releases.

@dwoz
Copy link
Contributor

dwoz commented Nov 18, 2025

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.

@vitalvas vitalvas changed the base branch from master to 3007.x November 18, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.