Repository navigation
Keep the scheduler CPU grant out of local readiness receipts #1698
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -253,6 +253,9 @@ def settings_fingerprint(config: Config, worktree: Path, *, base: str | None = N | |
| settings = _execution_settings(config, base) | ||
| if config.check_runner and settings["runner_executable"] is None: | ||
| return None | ||
| if not config.check_runner and "HEAVY_SLOT_GRANTED_CORES" not in config.env: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: A variable name from one downstream project is hardcoded into a generic fingerprint The exemption names This is acceptable as a narrow fix. Moving the name to a module-level constant next to |
||
| # The inherited local worker limit is transient. Stage reuse still binds it. | ||
| settings["environment"].pop("HEAVY_SLOT_GRANTED_CORES", None) | ||
| payload = [settings, config.inputs] | ||
| return hashlib.sha256(json.dumps(payload, sort_keys=True).encode()).hexdigest() | ||
|
|
||
|
|
||
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.
suggestion: The explicit-grant guard never applies because config.env holds (name, value) pairs
Config.envis declared astuple[tuple[str, str], ...]intypes.py:44. Because of that,"HEAVY_SLOT_GRANTED_CORES" not in config.envcompares the string against pairs, so it is always True. The grant is therefore removed fromsettings["environment"]even when it was set explicitly inchecks.env.The acceptance criterion still holds today, but only by accident:
_execution_settingsalso copies the rawenvfield fromasdict(config)into the digest, so a changed explicit value still changes the fingerprint. The guard looks like it does something it doesn't. If the redundantenvkey is ever dropped from the settings, the bug will surface silently.Smallest fix: test against
dict(config.env), or{name for name, _ in config.env}. Also add a test case that sets the grant throughchecks.env, changes its value, and asserts that_current_check_reportreturns None. That would cover the second acceptance bullet, which has no test right now.