sfqd-core: add refundable queued cancellation - #23
Merged
Merged
Conversation
Allow callers to opt into returning reserved virtual cost when a queued job is cancelled. Move representability checks to admission so accepted queued work remains unconditionally cancellable. Preserve the existing charged-cost policy as the default and document the resulting fairness boundary.
Expose accounting policy as an explicit benchmark dimension for isolated cancellation, cancel-and-replace cycles, and idle-reset workloads. Keep the default policy for unrelated workloads and extend fixture smoke coverage so every new cancellation variant is validated before measurement.
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.
Summary
REFUND_CANCELLED_COSTaccounting while preservingCHARGE_RESERVED_COSTas the defaultNumeric contract
Refund-mode admission validates a common denominator and the maximum unreduced accumulated numerator for every affected queued chain. A prospective overflow returns
NUMERIC_LIMITas an atomic no-op.The regression uses a publicly reachable 133-enqueue trace: an anchor preserves the busy period, the first target enqueue is accepted, the second is rejected without mutation, and the accepted target remains cancellable.
Verification
./mvnw --batch-mode --no-transfer-progress clean verify./mvnw --batch-mode --no-transfer-progress -Pjcstress clean verify— 182/182 passed./mvnw --batch-mode --no-transfer-progress -Pbenchmarks clean verify— 25 workloads discovered, 90/90 idle-reset smoke cases passedShort benchmark smoke checks validate wiring only; this PR makes no performance claim.