Repository navigation
feat(server): log pipeline create phase durations (RIG-10960) - #177
Closed
rigel-mintaka wants to merge 3 commits into
Closed
rigel-mintaka wants to merge 3 commits into
rigel-mintaka wants to merge 3 commits into
Conversation
Pipeline create takes 79 to 289 seconds on orion and ends in a write i/o timeout, but the logs do not say which phase is slow. Each phase of create and start now logs one debug line with a phase name, a duration, the repo id, and the pipeline number. The phases are store-insert, config-fetch, parse, queue-push, and forge-status. Behaviour and ordering do not change. The timers only wrap the existing calls. A new startPhase helper in server/pipeline/phase_timing.go holds the logging. Its two unit tests pin the log shape and the error path. Co-authored-by: Matt Wilkinson <matt@rigel.build>
The two forge-status timers shared one phase name, so a slow status post could not be told apart by call site. publishPipeline and start now log forge-status-publish and forge-status-start. publishPipeline also runs on approve and restart, so the log message is now the neutral "pipeline phase" instead of "pipeline create phase". Each phase line also carries the repo full name, next to repo_id, so a line can be read without a lookup. Co-authored-by: Matt Wilkinson <matt@rigel.build>
The phase timing tests used a private repository name as their fixture. They now use RigelBuild/example, the same fixture PR 176 uses in create_drop_test.go. The startPhase doc comment now says "pipeline phase" instead of "phase of pipeline creation", because publishPipeline also runs on approve and restart. No behaviour changes. The log line keeps the same fields. Co-authored-by: Matt Wilkinson <matt@rigel.build>
Author
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.
What does this do
Logs a debug line with its duration for each phase of pipeline create and start: store insert, config fetch, parse, queue push, and both forge-status updates (
forge-status-publish,forge-status-start). Each line carriesphase,duration,repo,repo_id,number, anderrorwhen the phase failed.Why do we need it
Pipeline create sometimes takes several minutes and ends in a write i/o timeout, so callers with a short client timeout give up. Nothing shows which phase is slow. Reading the code points at the forge status updates, which run up to three times per create with one forge call per workflow, but that has not been measured.
Summary
server/pipeline/phase_timing.go:startPhasereturns adone(err)that logs one debug line.create.goandstart.go. Call order and error handling are unchanged.Verification
go build ./...,go vetandgo test ./server/pipeline/...pass, andgofmtis clean.Risks
None at the default log level. Turning on debug logging adds 6 lines per create.
Spec impact
Spec-impact: none (debug logs only)
Refs RIG-10960
Co-authored-by: Matt Wilkinson matt@rigel.build