Mesh sidecar can be left unconfigured after the sidecar monitor restarts it

XMLWordPrintable

    • 1
    • Severity 2 - Major

      Issue Summary

      When the sidecar monitor in DefaultSidecarManager restarts the Mesh sidecar process, the new process starts with no configuration. Bitbucket detects this (the sidecar rejects RPCs with RpcNodeUnconfigured) and ErrorHandlingClientInterceptor calls MeshController.configure(sidecar), but DefaultMeshController only pushes configuration when its locally cached sidecar config version differs from the control plane state.

      That cache is cleared only when the gRPC channel to the sidecar transitions to TRANSIENT_FAILURE and the node registry publishes an offline event. A restart in which the channel reconnects without observing a failure (READY -> IDLE -> CONNECTING -> READY) never clears it, so every configure call is a no-op and the sidecar stays unconfigured indefinitely. Nothing else reconciles the sidecar: the sidecar monitor's heartbeat and the health check use RPCs that Mesh allows on an unconfigured node, so the sidecar looks healthy, and the periodic MeshConfigurationJob only re-checks standalone Mesh nodes.

      Steps to Reproduce

      1. Run a node with the Mesh sidecar enabled and no incoming Git traffic.
      2. Cause the sidecar monitor to restart the sidecar (for example, stall the process long enough to miss 5 heartbeat periods, or kill the Mesh process so it is restarted).
      3. Wait for "Sidecar started after ...ms" and then send a Git request to the node.

      Expected Results

      The restarted sidecar is configured, either when it comes back or on the first request that finds it unconfigured, and Git requests succeed.

      Actual Results

      Every request to the node fails with the repository reported as offline, and the log repeats every 30 seconds without any accompanying failure:

      INFO  c.a.s.i.s.g.m.ErrorHandlingClientInterceptor Configuring node Sidecar(http://localhost:7777) because it's been unconfigured for 186s
      WARN  c.a.s.i.s.g.m.DefaultErrorTranslator MYPROJ/myrepo[123]: The target node has not been configured (Uptime: 123s)
      INFO  c.a.s.i.s.DefaultHttpScmRequestExecutor A request was denied because the repository [MYPROJ/myrepo[123]] was offline.
      

      Workaround

      Restart Bitbucket on the affected node.

              Assignee:
              Ben Humphreys
              Reporter:
              Ben Humphreys
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: