Repository navigation
fix(server): log SetPerm permission refresh duration (RIG-11816) - #188
Closed
rigel-mintaka wants to merge 1 commit into
Closed
rigel-mintaka wants to merge 1 commit into
rigel-mintaka wants to merge 1 commit into
Conversation
Log the forge permission refresh in SetPerm at INFO with its duration, the age of the stored permission, the repo, the user and any error. Log at WARN when the refresh takes longer than 5s. No behavior change. Refs RIG-11816 Co-authored-by: Matt Wilkinson <matt@rigel.build>
Author
|
All-clear at 1a2d3c3 |
Author
|
Ported as RigelBuild/nebula#224 (forks/woodpecker). Closing this PR. The fork's release minter goes away in orion#8810, so fixes ship from nebula now. Refs RIG-11816. |
rigel-nemo Bot
pushed a commit
to RigelBuild/nebula
that referenced
this pull request
Nov 23, 2026
…224) ## What does this do Ports RigelBuild/woodpecker#188 into the fork. `SetPerm` now logs each forge permission refresh with its duration, the age of the stored permission, the repo, the user, and the error. A refresh over 5 s also logs a WARN line. ## Why do we need it RIG-11816 reports `/config` requests stalling 31 to 100 s. One suspect is the `_forge.Repo` call in `SetPerm`. It has no timeout, and it runs when the stored permission is over an hour old. These logs show the duration after deploy, so the suspect can be confirmed or ruled out. ## Summary - `forks/woodpecker/server/router/middleware/session/repo.go`: timing and two log lines around `_forge.Repo`. No control-flow, timeout, or error-handling change. ## Verification - `gofmt -l` clean on the touched file. - Test run off-box on macpro2013 (`go test -tags test`), see the PR body. ## Risks One INFO line per stale-permission refresh, at most one per user and repo per hour. Ports RigelBuild/woodpecker#188. ## Spec impact Spec-impact: none Refs RIG-11816 Co-authored-by: Matt Wilkinson <matt@rigel.build>
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
RIG-11816 reports
/configrequests stalling 31 to 100 s. One suspect is the forge permission refresh inSetPerm(server/router/middleware/session/repo.go). It calls_forge.Repowith no timeout when the stored permission is over an hour old.This PR only adds logging. It does not prove or refute the cause by itself. The logs will show it after deploy.
SetPerm refreshon every refresh attempt, withduration,synced_age,repo,user, anderr.SetPerm refresh slowwhen the refresh takes longer than 5 s.No control-flow, timeout, or error-handling change.
Verification
Run on macpro2013 with
-tags test(the Makefile passes it):go build ./server/...OKgo vet -tags test ./server/router/middleware/session/OKgo test -tags test -count=1 ./server/router/middleware/session/...ok ... session 0.103s,TestSetPermpassesgofmt -lcleanAfter deploy
Query Loki for slow refreshes:
{service_name="woodpecker-server"} |= "SetPerm refresh"A
durationnear 31 to 100 s on the/configpath confirms the hypothesis. Short durations refute it.Spec impact
None.
Risks
Log volume: one INFO line per stale-permission refresh (at most one per user and repo per hour).
Refs RIG-11816
Co-authored-by: Matt Wilkinson matt@rigel.build