Repository navigation
BugFix: prevent sysctl reset from re-caching modified parameter values - #4857
Open
Austin Aviv (austinaviv) wants to merge 2 commits into
Open
Austin Aviv (austinaviv) wants to merge 2 commits into
Austin Aviv (austinaviv) wants to merge 2 commits into
Conversation
Austin Aviv (austinaviv)
requested review from
LiliDeng and
Johnson (johnsongeorge-w)
as code owners
November 3, 2026 16:26
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the sysctl caching and reset changes.
No open issues 🎉
What changed in this PR
Fixes #4856 by separating sysctl writes from baseline caching, so resetting node settings clears tracked values without caching modified values again.
Changes:
- Adds
_set()for writes that do not update the baseline cache. - Updates
reset()to restore original values directly. - Adds unit tests for baseline caching, cache cleanup, repeated resets, and BSD polling cleanup.
Suggested integration validation (not run):
Key Test Cases:
perf_sockperf_latency_tcp_sriov_busy_poll
Impacted LISA Features:
None directly; Sysctl is a tool rather than a feature class.
Tested Azure Marketplace Images:
- canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
| File | Description |
|---|---|
selftests/test_sysctl.py |
Adds regression tests for caching and reset behavior. |
lisa/tools/sysctl.py |
Separates low-level writes from caching to make resets idempotent. |
Review effort: Balanced
LiliDeng
reviewed
Nov 4, 2026
This branch has not been deployed
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
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.

Description
In Sysctl.reset(), variables were popped from _original_values and restored via self.write(key, original_value). Because the key was already popped, write() encountered a KeyError and called self.get() to query the system value before writing. Since the system had not yet been restored, _original_values[key] was repopulated with the test/modified value rather than being cleared.
This caused _original_values to retain modified values after
eset(), making repeated
eset() calls write the test values back to the system and corrupting baseline tracking for subsequent tests on the node.
This PR introduces an internal _set() helper for executing sysctl -w commands. write() delegates to _set() while caching the original value if not present, and
eset() uses _set() to restore original values without re-populating _original_values.
Related Issue
Fixes #4856
Type of Change
Checklist
Test Validation
Key Test Cases:
perf_sockperf_latency_tcp_sriov_busy_poll
Impacted LISA Features:
Sysctl
Tested Azure Marketplace Images:
N/A
Test Results