Skip to content

fix(metrics): record the metadata lock hold time once per lock - #979

Merged
aduffeck merged 1 commit into
opencloud-eu:mainfrom
butonic:fix-lock-held-metric
Nov 9, 2026
Merged

aduffeck merged 1 commit into
opencloud-eu:mainfrom
butonic:fix-lock-held-metric

Conversation

@butonic

@butonic butonic commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

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 to reva_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.

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]>
@butonic
butonic requested a review from aduffeck November 5, 2026 13:47
@butonic butonic self-assigned this Nov 5, 2026
@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Nov 5, 2026
@butonic butonic moved this from Qualification to Needs Review in OpenCloud Team Board Nov 5, 2026
@aduffeck
aduffeck merged commit e08d6a8 into opencloud-eu:main Nov 9, 2026
20 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in OpenCloud Team Board Nov 9, 2026
@openclouders openclouders mentioned this pull request Nov 9, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants