-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Merge forward 3007.x into master #68661
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
twangboy
merged 51 commits into
saltstack:master
from
dwoz:merge/3007.x/master-25-01-26
Jan 28, 2026
Merged
Merge forward 3007.x into master #68661
twangboy
merged 51 commits into
saltstack:master
from
dwoz:merge/3007.x/master-25-01-26
Jan 28, 2026
+697
−896
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…orkflow Remove winrepo update workflow
Fix typo in salt.utils.cloud to be winrm
A 5 second timeout causes things to start failing when 2 second artificial network delay is introduced. Changeing the default here to 15 seconds to avoid causeing all programatic usages of LocalClient to adjust their timeouts.
Update urllib3 to 2.6.3
Patch tornado for BDSA-2025-60811
Bump LocalClient pub and pub_async timeouts
* Remove RPATH from shared libraries that do not link to any other libraries in our environment. * Ensure we always return a proper and consistang default python version for create, fetch, build commands.
Bump relenv to 0.22.2
Update tornado to 6.5.4
Adds lazy_loader_strict_matching option and grains cleanup to reduce
memory footprint by 51% through configuration-based optimization.
Changes:
1. salt/loader/lazy.py:
- Add lazy_loader_strict_matching config option to disable expensive
Bueller fallback search in _iter_files()
- Enhance clean_modules() to clear internal caches (_dict,
loaded_modules, loaded_files, missing_modules) in addition to
removing modules from sys.modules
2. salt/loader/__init__.py:
- Call funcs.clean_modules() at end of grains() function to free
memory after grains are loaded
Impact when lazy_loader_strict_matching is enabled:
- Memory: 127 MB → 62 MB (65 MB saved, 51% reduction)
- Modules: 1122 → 74 (1048 fewer, 93% reduction)
- Requires opt-in configuration
- No code changes to execution/state modules needed
- Clean, simple implementation
Configuration:
Set lazy_loader_strict_matching: True in minion config to enable.
Validates that grains modules are properly unloaded and garbage collected after salt.loader.grains() completes. Tests cover: - Modules removed from sys.modules - Modules actually garbage collected (via weakrefs) - Idempotent cleanup on repeated calls - Internal loader state cleared (_dict, loaded_modules, etc) - Cleanup works even with errors - clean_modules() method functionality - Both normal and force_refresh modes All 8 tests pass, confirming grains cleanup is working correctly.
Critical fix: base stub modules (salt.loaded.int, salt.loaded.int.{tag},
salt.loaded.ext, salt.loaded.ext.{tag}) are shared infrastructure used
by multiple loaders and must not be removed during cleanup.
Changes:
- salt/loader/lazy.py: Updated clean_modules() to preserve base stubs
while still removing actual loaded modules
- tests: Added test_base_stubs_preserved_across_loaders() to verify
one loader's cleanup doesn't break other loaders
- tests: Updated all tests to account for base stubs correctly
Without this fix, cleaning up one loader would remove the base stubs,
breaking any other loaders that depend on them.
All 9 tests pass.
Adds lazy_loader_strict_matching: True to test configurations to validate that strict matching mode works correctly across the entire test suite. Changes: - tests/pytests/conftest.py: Added to all minion factory configs (salt_minion_factory, salt_sub_minion_factory, salt_proxy_minion_factory) - tests/pytests/unit/conftest.py: Added to unit test minion_opts fixture - tests/pytests/functional/conftest.py: Added to functional test minion config - tests/integration/files/conf/minion: Added to integration test config file This will help validate that: 1. Strict matching doesn't break any existing tests 2. All virtualname lookups work with partial matching (step 2) 3. Bueller (step 3) is truly unnecessary 4. Memory optimization works in real-world scenarios Running the test suite with this enabled will provide comprehensive validation of our assumptions about loader behavior.
- Only remove modules matching this loader's tag, not all modules - Recursively clean injected loaders in pack (__utils__, etc.) - Prevent infinite recursion from circular loader references Fixes KeyError when runners execute after grains cleanup.
The test now allows base stub modules to remain after clean_modules(), matching the new behavior that preserves shared infrastructure.
c74e4ca to
7187e54
Compare
twangboy
approved these changes
Jan 28, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
What issues does this PR fix or reference?
Fixes
Previous Behavior
Remove this section if not relevant
New Behavior
Remove this section if not relevant
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes/No