Repository navigation
feat: ext.costLimit — a per-task spend cap - #101
Merged
Merged
Conversation
TTL was the only ceiling on a task, so a fan-out of N tasks had a worst case of N x ext.ttl x the instance rate with no second belt. spored enforces TTL and cost INDEPENDENTLY and the first to fire wins, so this is a genuine second limit rather than a refinement of the first. The failure it catches is the expensive one: a task that HANGS rather than fails produces no exit status for Nextflow to retry or abort on, so it bills until the TTL expires. Found in a cross-adapter audit prompted by snakemake-executor-plugin-spawn#12 — NO adapter emitted lifecycle.cost_limit, so this was a uniform gap across every workflow integration rather than an nf-spawn oversight. buildLifecycle emits cost_limit only when set and positive. costLimit arrives as a String because every ext directive does, so it is parsed rather than assumed numeric, and a non-numeric value degrades to 'bounded by TTL only' with a warning instead of aborting the pipeline: a typo in nextflow.config should not kill a run that is otherwise fine. Non-positive is treated as unset — a zero cap would mean 'terminate immediately', never what someone typing 0 intends. 105 tests pass. Two existing buildTaskSpec tests call it positionally, so the new parameter shifted their arguments; updated rather than appended-last, keeping the signature grouped with ttl where it belongs. Negative check confirmed: disabling the emission fails the two new specs. Fixes #100
The directives table is where someone looks for 'what can I set per process', so a knob that only exists in the CHANGELOG is effectively undiscoverable. The entry states the property that makes it worth setting: spored enforces it INDEPENDENTLY of the TTL, so it catches a task that hangs rather than fails.
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.
Fixes #100.
TTL was the only ceiling on a task, so a fan-out of N tasks had a worst case of N ×
ext.ttl× the instance rate with no second belt.sporedenforces TTL and cost independently — first to fire wins — so this is a genuine second limit, not a refinement of the first.The failure it actually catches is the expensive one: a task that hangs rather than fails produces no exit status for Nextflow to retry or abort on, so it bills until the TTL expires.
Two robustness choices
costLimitarrives as a String, because everyextdirective does — so it's parsed rather than assumed numeric:nextflow.configshouldn't kill a run that's otherwise fine.0intends.Context
Found in a cross-adapter audit prompted by snakemake-executor-plugin-spawn#12: no adapter emitted
lifecycle.cost_limit, so this was a uniform gap across every workflow integration rather than an nf-spawn oversight. Also filed as miniwdl-spawn#12, cwl-spawn#12, airflow-spawn#12, pegasus-spawn#5 — the first three are already merged.Verification
105 tests pass (built with
JAVA_HOME=/opt/homebrew/opt/openjdk@17per the repo's requirement). Negative check confirmed: disabling the emission fails the two new specs.Note two existing
buildTaskSpectests call it positionally, so the new parameter shifted their arguments. I updated them rather than appending the parameter last — keeping it grouped withttl, where it belongs semantically.