Skip to content

bug(operator): VirtualMCPServer statusReportingInterval requeue Updates the Deployment every interval (no rollout) #6340

Closed

Description

@RaviTharuma

Status

Fix PR: #6377


Bug description

On operator/vmcp v0.43.0, a VirtualMCPServer with config.operational.failureHandling.statusReportingInterval: 1m produces a DeploymentUpdated event pair every minute, and the operator logs Updating Deployment on the same cadence.

The backing Deployment’s pod template does not change (same ReplicaSet for days, no new rollout). The event text still says “rolling out new configuration”.

This is the same symptom class as #5819, but it happens with no external admission webhook / sidecar injector writing pod-template labels or annotations. The live pod template only has operator-owned keys (toolhive.stacklok.dev/runconfig-checksum + the usual toolhive labels).

Sibling VirtualMCPServers in the same namespace without statusReportingInterval set do not emit these events.

Steps to reproduce

  1. Install ToolHive operator v0.43.0 on Kubernetes.
  2. Create a VirtualMCPServer that already has a Ready Deployment, and set:
spec:
  config:
    operational:
      failureHandling:
        statusReportingInterval: 1m
        healthCheckInterval: 5m
        healthCheckTimeout: 15s
        unhealthyThreshold: 3
        partialFailureMode: fail
  1. Watch:
kubectl get events -n <ns> --field-selector involvedObject.kind=VirtualMCPServer
kubectl logs -n <ns> deploy/toolhive-operator | grep 'Updating Deployment'
kubectl get deploy <vmcp-name> -n <ns> \
  -o custom-columns='GEN:.metadata.generation,REV:.metadata.annotations.deployment\.kubernetes\.io/revision'
kubectl get rs -l toolhive-name=<vmcp-name> -n <ns>

Expected behavior

  • Status reporting updates VirtualMCPServer.status (backend health / phase) only.
  • ensureDeployment is a no-op when the desired pod template is unchanged.
  • DeploymentUpdated / “rolling out new configuration” is emitted only when a new ReplicaSet is actually created.

Actual behavior

  • Every ~60s (exactly the configured statusReportingInterval): two DeploymentUpdated events and two Updating Deployment log lines (two reconcile IDs at the same timestamp).
  • Deployment metadata.generation can move; deployment.kubernetes.io/revision and the active ReplicaSet stay put.
  • Event stream is unusable for real config changes. Extra apiserver write load on every status tick.

Observed on one tenant (11 backends, unique podTemplateSpec + telemetryConfigRef). Three other vMCPs in the same cluster, same operator, no statusReportingInterval, stay quiet.

Environment (if relevant)

  • OS/version: Talos Linux, single-node Kubernetes
  • ToolHive version: operator + proxyrunner + vmcp images v0.43.0

Additional context

Docs say statusReportingInterval “controls how often the vMCP runtime reports backend health and phase changes” and that lower values increase API server load. That should mean status patches, not Deployment writes.

Likely: a VMCP status update re-enqueues the VirtualMCPServer reconciler, and ensureDeployment treats something as drift (hash / map equality / defaulting) and calls Update + DeploymentUpdated even when spec.template is identical.

Related: #5819 (hot-loop when an external controller annotates the pod template — different trigger, same event). #5817 / #5818 (other ensureDeployment hot-loops, already closed).

No credentials or private hostnames in this report.

Activity

  1. added
    needs-triage
    on Aug 15, 2026
  2. RaviTharuma commented on Aug 15, 2026

    @RaviTharuma
    ContributorAuthor

    Follow-up from the same v0.43.0 cluster after we omitted statusReportingInterval from GitOps (thinking that would stop the loop).

    The CRD defaults the omitted field to 30s. After apply, all four VirtualMCPServers showed spec.config.operational.failureHandling.statusReportingInterval: 30s, and the lava DeploymentUpdated cadence went from ~1m to ~30s (worse). Sibling vMCPs without a unique podTemplateSpec env block still only emit a one-shot update on a real spec change.

    So the interval is the loop period, including the CRD default. Omitting the field is not a workaround.

    Local mitigation we are using until this is fixed: set an explicit long value (15m) so status stays useful without a write storm. Happy to test a patch that skips ensureDeployment Update when the pod-template hash is unchanged.

  3. reyortiz3 commented on Aug 18, 2026

    @reyortiz3
    Collaborator

    Thanks for the detailed report, @RaviTharuma, and for the follow-up data point on the 30s default making it worse — that confirms the interval itself is the loop period, not something specific to a manually-set value.

    Your hypothesis on the fix is right: ensureDeployment should skip the Update call when the pod-template hash is unchanged, rather than treating the requeue itself as drift. This is a good candidate for a community contribution — since you already offered to test a patch, feel free to open a draft PR along those lines and we will help align on where the hash comparison should live.

    Thanks again for taking the time to file this and the follow-up.

  4. RaviTharuma commented on Aug 19, 2026

    @RaviTharuma
    ContributorAuthor

    Opened #6377. Status-interval requeues no longer Update the Deployment when the pod template is unchanged: subset metadata compare (so user podTemplateSpec extras are not drift) plus a skip-write if the computed template is identical.

  5. added and removed
    needs-triage
    on Aug 24, 2026
  6. added 2 commits that reference this issue on Aug 30, 2026
    fb3753a
    a012441
  7. RaviTharuma commented on Sep 2, 2026

    @RaviTharuma
    ContributorAuthor

    Addressed in:

    Closing this issue because the fix is already filed as an upstream PR. The PR stays open for review; not merging from here.

  8. RaviTharuma commented on Sep 2, 2026

    @RaviTharuma
    ContributorAuthor

    Resolved via #6377

  9. added a commit that references this issue on Sep 3, 2026
    572b35b
  10. added a commit that references this issue on Sep 10, 2026
    bb4c185
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions