Skip to content

Log routine vMCP cache sync messages at debug - #7216

Merged
ChrisJBurns merged 1 commit into
stacklok:mainfrom
FOWEPJF255:codex/fix-vmcp-cache-sync-logs
Nov 22, 2026
Merged

ChrisJBurns merged 1 commit into
stacklok:mainfrom
FOWEPJF255:codex/fix-vmcp-cache-sync-logs

Conversation

@FOWEPJF255

Copy link
Copy Markdown
Contributor

Summary

Repeated vMCP readiness checks emit roughly 40 routine cache-sync messages per minute at info level, obscuring useful operational logs. Move the wait and successful-sync messages in WaitForCacheSync to debug level. The unstarted-watcher and failed-sync paths keep their warnings and return values.

Fixes #7109

Type of change

  • Bug fix

Test plan

  • Manual testing (isolated logging probe): extracted the actual method bodies from the base and patched source and ran them with Go 1.27.0, using a stand-in for the controller cache. The baseline emits both routine messages at INFO. After the fix, INFO suppresses them, DEBUG emits them, and both failure paths retain their warnings and return false. All four patched cases passed.
  • gofmt and git diff --check passed. This probe does not exercise a Kubernetes cluster or replace the full ToolHive test suite, which was not run locally.

Does this introduce a user-facing change?

Before: routine readiness polling prints both cache-sync messages at info level. After: those messages require debug logging; failure warnings remain visible at the normal log level.

Implementation plan

Implementation scope

Change only the two routine slog.Info calls in BackendWatcher.WaitForCacheSync to slog.Debug, keep warning and synchronization behavior intact, and check the before/after logging behavior. The issue was assigned before implementation.

Prepared and checked with Codex assistance.

Keep readiness polling quiet at info level while retaining warnings for unstarted watchers and failed cache synchronization.

Signed-off-by: FOWEPJF255 <lhi25wy@163.com>
@ChrisJBurns

Copy link
Copy Markdown
Collaborator

@FOWEPJF255 Nice and simple@ Thanks!

@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.63%. Comparing base (b29650b) to head (a0ce6ea).

Files with missing lines Patch % Lines
pkg/vmcp/k8s/manager.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7216      +/-   ##
==========================================
+ Coverage   81.58%   81.63%   +0.04%     
==========================================
  Files         898      898              
  Lines       91580    91580              
==========================================
+ Hits        74718    74763      +45     
+ Misses      16857    16812      -45     
  Partials        5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisJBurns
ChrisJBurns merged commit 86f8b88 into stacklok:main Nov 22, 2026
43 checks passed
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.

Reduce log spam of vMCP pod by logging cache sync messages at debug

2 participants