Skip to content

[FEA]: Enforce the ip operator's per-Verifier deadline in the controller #96

Open

Description

@anandj91

Is this a new feature, an improvement, or a change to existing functionality?

Improvement

How would you describe the priority of this feature request

Low

Please provide a clear description of problem this feature solves

#70 gives every cluster_base Verifier its own 30-second deadline (verifyTimeout in internal/controller/ip/cclclusterconfig_controller.go). The deadline is cooperative: context.WithTimeout only cancels the context, and verify then waits for every Verifier goroutine with wg.Wait().

A Verifier that blocks without honouring ctx.Done(), for example on a channel or a library call that takes no context, keeps wg.Wait() from returning. The pass never finishes, the Verified condition is never written, and the controller stalls on the CCLClusterConfig singleton instead of reporting that chart as timed out (#70 (comment)).

Today this is handled by contract: catalogs.Verifier requires an implementation to return once ctx is done. Every Verifier is still DefaultVerifier, so there is no exposure yet. The risk grows as the real checks in #91 land.

Describe your ideal solution

Have the controller enforce the deadline rather than rely on each Verifier:

  • Run each Verifier behind a result channel and select on its result versus the deadline.
  • When the deadline wins, report the chart as timed out after 30s and stop waiting for it.
  • Keep results deterministic in catalog order, and keep the panic recovery.

Describe any alternatives you have considered

  • Keep the cooperative deadline and the contract (current behaviour): no leaked goroutines, but one non-compliant Verifier can stall verification. Acceptable while every Verifier is reviewed in-repo code.
  • Review-time enforcement only: check in review that each Verifier passes ctx to its calls and checks it in its own loops. Cheap, but easy to miss for a library call that ignores context.

Additional context

Trade-offs to settle when implementing:

  • Leaked goroutines: Go cannot stop a goroutine from outside. An abandoned Verifier keeps running, and a Verifier stuck forever adds one goroutine per pass (every minute while failing). Consider skipping a chart whose previous call is still running and reporting it as still running, rather than starting another call.
  • Data race: the result slice is written by position today. A late writer must not touch results after verify has returned. Send results over buffered channels instead.
  • Testing: an envtest spec with a Verifier that ignores ctx needs a deadline shorter than 30s. Either expose the timeout to tests or test verify with an injected deadline.

Modules affected: internal/controller/ip, catalogs/verify.go (contract wording), DESIGN.md §3a.

Activity

  1. added
    enhancement
    go
    on Oct 7, 2026
  2. linear commented on Oct 7, 2026

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgo

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions