Skip to content

feat(server): log pipeline create phase durations (RIG-10960) - #177

Closed
rigel-mintaka wants to merge 3 commits into
rigel-releasefrom
ci-pipelines/rig-10960-log-pipeline-create-phase-durations
Closed

rigel-mintaka wants to merge 3 commits into
rigel-releasefrom
ci-pipelines/rig-10960-log-pipeline-create-phase-durations

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Nov 19, 2026 •

Copy link
Copy Markdown

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 carries phase, duration, repo, repo_id, number, and error when 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

  • New server/pipeline/phase_timing.go: startPhase returns a done(err) that logs one debug line.
  • Timers in create.go and start.go. Call order and error handling are unchanged.

Verification

  • go build ./..., go vet and go test ./server/pipeline/... pass, and gofmt is clean.
  • With debug off the timer costs 52 ns and 0 allocs per phase (temporary benchmark).

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

rigel-mintaka and others added 2 commits November 19, 2026 02:50
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>
@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

RIG-10960

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>
@rigel-mintaka

Copy link
Copy Markdown
Author

Superseded by #178: same tree as 9253352, in one commit with a clean message, so the squash body carries no private name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant