Repository navigation
fix(metrics): record the metadata lock hold time once per lock - #979
Merged
Merged
Conversation
The async propagator unlocks a node explicitly and again in a defer. Every call to heldLock.Close observed the hold time, so a single lock added two samples to reva_metadata_lock_held_seconds, and the second one included the work done after the lock had been released. That inflated both the count and the durations. We now only record the hold time on the first Close. Repeated unlocks still return the error of the already closed lock file, like before. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
aduffeck
approved these changes
Nov 9, 2026
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.
The async propagator unlocks a node explicitly and again in a defer (
tree/propagator/async.go:304,400). Each call observed the hold time, so one lock added two samples toreva_metadata_lock_held_seconds, and the second one included work done after the lock was released.We now only record the hold time on the first
Close. A repeated unlock still returns the error of the already closed lock file, like before.reported in #977 (comment)
introduced in #953
Assisted by Claude Code (claude-opus-5-5): it checked where the problem came from, wrote the fix, the spec and this description.