Skip to content

[deep-report] 4 production retry/backoff paths use uncancellable time.Sleep, invisible to the timesleepnocontext linter #64823

Description

@github-actions

Description

Four production retry/backoff code paths call time.Sleep directly with no context.Context to make the wait interruptible — a caller pressing Ctrl-C (or a cancelled parent context) cannot stop them mid-wait:

  • pkg/cli/run_workflow_tracking.go:73 — exponential-backoff poll loop in getLatestWorkflowRunWithRetry.
  • pkg/cli/trial_repository.go:199 — fixed trialRepoInitDelay sleep in ensureTrialRepository.
  • pkg/cli/update_extension_check.go:412 — retry-delay sleep in cleanupStaleWindowsBackups.
  • pkg/workflow/docker_validation.go:220 — the worst case: exponential backoff (waitTime *= 2) for Docker image pull retries inside validateDockerImage, which has no ctx parameter at all.

The -timesleepnocontext linter is enabled in CI (cgo.yml:1487,1490) specifically to catch this pattern, but it only flags functions that already take a context.Context parameter — none of these four functions do, so the linter has a structural blind spot and all four sites pass CI clean.

Expected Impact

Makes long-running CLI operations (workflow-run polling, trial-repo setup, extension cleanup, Docker image validation) actually respond to Ctrl-C / command cancellation instead of blocking for the full backoff duration — most visible on the Docker pull path, which can back off for tens of seconds per retry.

Suggested Agent

GitHub Copilot coding agent (thread a context.Context through each of the four call chains and replace time.Sleep with a select on ctx.Done() / a timer, or use an existing cancellable-sleep helper if one exists in pkg/cli/pkg/workflow).

Estimated Effort

Medium (1-4 hours) — four separate call sites, some requiring a ctx parameter to be plumbed through an existing call chain.

Data Source

DeepReport Intelligence Briefing — 2026-10-01, sourced from Repository Quality Improvement Report #64772 ("Uncancellable Sleep & Sleep-Based Test Synchronization"), all four sites live-verified by direct file read.

Generated by 🔬 Deep Report · claude · agent · 302 AIC · ⌖ 15.3 AIC · ⊞ 7.3K · ◷

  • expires on Oct 3, 2026, 10:45 AM UTC-08:00

Activity

  1. github-actions commented on Oct 3, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-10-03T18:45:46.314Z.

    Closed by Workflow

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions