Skip to content

fix: deduplicate identical parked-server reconnect warnings (Closes #1391) - #1418

Closed
Lexus2016 wants to merge 1 commit into
mainfrom
evolution/issue-1391-mcp-log-dedup
Closed

fix: deduplicate identical parked-server reconnect warnings (Closes #1391)#1418
Lexus2016 wants to merge 1 commit into
mainfrom
evolution/issue-1391-mcp-log-dedup

Conversation

@Lexus2016

Copy link
Copy Markdown
Owner

Automated evolution PR for issue #1391.

Problem

When an MCP server is parked (reconnect budget exhausted) and the self-probe repeatedly fails with the same error, the WARNING was emitted every _PARKED_RETRY_INTERVAL cycle — 739 duplicate log lines observed for tqmemory on startup, drowning real errors in noise.

Fix

Added _last_parked_error tracking to MCPServerTask:

  • First occurrence of an error: logged at WARNING (unchanged behavior)
  • Subsequent identical errors: dropped to DEBUG with "still parked" message
  • Different error: fresh WARNING (so new failure modes are never hidden)
  • Dedup key reset only on successful reconnection (where _reconnect_retries is cleared to 0), NOT at the start of each revival attempt — so repeated identical failures during parking are properly suppressed

Changes

  • tools/mcp_tool.py: Added _last_parked_error to __slots__ and __init__; dedup logic in the parked-server warning path; reset on successful reconnection (2 sites)
  • tests/tools/test_mcp_parked_self_probe.py: Added test_parked_server_dedup_identical_warnings verifying first WARNING is emitted, subsequent identical cycles are DEBUG

Validation

  • Lint: ✓ (ruff check)
  • Tests: 2/2 passed (tests/tools/test_mcp_parked_self_probe.py)

Co-Authored-By: Hermes Evolution evolution@hermes.ai

…1391)

When an MCP server is parked (reconnect budget exhausted) and the
self-probe repeatedly fails with the same error, the WARNING was emitted
every _PARKED_RETRY_INTERVAL cycle — 739 duplicate lines observed for
tqmemory on startup. Added _last_parked_error tracking: first occurrence
logs at WARNING, subsequent identical errors drop to DEBUG. The dedup
key is only reset on successful reconnection (where _reconnect_retries
is cleared to 0), not at the start of each revival attempt, so repeated
identical failures are properly suppressed.

Co-Authored-By: Hermes Evolution <evolution@hermes.ai>
@github-actions github-actions Bot added the fix Bug or fix label Jul 28, 2026
@Lexus2016

Copy link
Copy Markdown
Owner Author

Superseded by #1417, which landed both #1390 and #1391 in a single merge. This PR's changes are now in main.

@Lexus2016 Lexus2016 closed this Jul 28, 2026
@Lexus2016
Lexus2016 deleted the evolution/issue-1391-mcp-log-dedup branch July 28, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug or fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant