fix(policy): prevent policy callback deadlocks and teardown leaks#118
Closed
fix(policy): prevent policy callback deadlocks and teardown leaks#118
Conversation
Collaborator
Author
|
Closing this PR, as #119 handles it. |
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 DCGM-3746 and DCGM-6904.
Both issues came from the same root cause:
ViolationRegistrationcould block while DCGM held internal locks.Summary
ViolationRegistrationnon-blocking by dropping on full per-condition queues and tracking drops withdroppedPolicyViolationsdcgmPolicyRegister_v2and make fan-in sends cancellation-aware so registration and teardown cannot hang on a full user-facing channel1to16to absorb short burstsWhy
policyChannelBuffer = 16DCGM_MAX_XID_INFO = 10(fromdcgm_structs.h) is the upstream design ceiling for in-flight XID events per callback, so the buffer must be>= 10to absorb a worst-case synchronous burst.16is the next power of two above10, giving small headroom for scheduler jitter without straying far from what DCGM itself considers the realistic ceiling.PolicyViolation~= 7 KB total. Sized larger (e.g.64) would be hard to defend in review for no measurable benefit.droppedPolicyViolationsever becomes non-zero in production, that is the signal to revisit the size -- not a guess.Tests
Added deterministic regression coverage for:
registerPolicypre-registration failure cleanupregisterPolicyandregisterPolicyOnly