Repository navigation
fix(upstream): prevent goroutine logging in Docker recovery monitor on Windows - #123
Merged
Merged
Conversation
…n Windows Fixed Windows test failures by adding context checks before logging in startDockerRecoveryMonitor. This prevents goroutines from logging after test completion. The issue occurred when: 1. Tests create a Runtime with upstream manager 2. Docker recovery monitor checks availability and finds Docker unavailable 3. Test completes and calls Close(), canceling context 4. Goroutine logs warning synchronously without checking context cancellation Changes: - Add context check before logging in initial Docker availability check - Add context check before logging in periodic monitoring ticker - Ensures goroutines respect context cancellation on all platforms Fixes Windows test failure: - Unit Tests (windows-latest, 1.23.10) https://github.com/smart-mcp-proxy/mcpproxy-go/actions/runs/19045548056/job/54392774796 Complements PR #122 which fixed the same issue on macOS/Linux. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Contributor
📦 Build Artifacts for PR #123Version: Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 19046003899 --repo smart-mcp-proxy/mcpproxy-go
# Or download a specific artifact:
gh run download 19046003899 --name dmg-darwin-arm64
|
Dumbris
added a commit
that referenced
this pull request
Nov 3, 2025
…ecovery retry Fixed another goroutine leak where Docker recovery retry logging occurred after test completion, causing panic: "Log in goroutine after test has completed". The issue occurred in handleDockerUnavailable when: 1. Timer fires and checkDockerAvailability is called 2. Docker check fails (returns error) 3. Test completes and context is cancelled 4. Goroutine logs "Docker recovery retry" without checking context This completes the fix for Docker recovery monitor logging issues by adding context checks before ALL logging statements. Changes: - Add context check before "Docker recovery retry" log (line 1896) - Ensures goroutine exits cleanly if context was cancelled during check Fixes test failures: - End-to-End Tests (macos-latest, 1.23.10) https://github.com/smart-mcp-proxy/mcpproxy-go/actions/runs/19046210469 Complements PR #122 and PR #123. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Dumbris
added a commit
that referenced
this pull request
Nov 3, 2025
…ellation Fixed OAuth event monitor goroutine leak where logging occurred after test completion, causing panic: "Log in goroutine after test has completed". The issue occurred in startOAuthEventMonitor when: 1. Ticker fires (every 5 seconds) 2. processOAuthEvents() is called 3. Test completes and context is cancelled 4. processOAuthEvents() logs debug message without checking context This is similar to the Docker recovery monitor issues fixed in PR #122, #123, #124. Changes: - Add context check after ticker fires, before calling processOAuthEvents() - Return immediately if context was cancelled during ticker wait - Prevents goroutine from logging after test cleanup Fixes test failures: - Unit Tests (windows-latest, 1.23.10) https://github.com/smart-mcp-proxy/mcpproxy-go/actions/runs/19046681617/job/54396553672 Error: ``` panic: Log in goroutine after TestUpdateListenAddressValidation has completed: 2025-11-03T19:28:45.714Z DEBUG processOAuthEvents: checking for OAuth completion events... goroutine 144 [running]: mcpproxy-go/internal/upstream.(*Manager).processOAuthEvents(0xc0006b64d0) D:/a/mcpproxy-go/mcpproxy-go/internal/upstream/manager.go:1493 +0x9e mcpproxy-go/internal/upstream.(*Manager).startOAuthEventMonitor(0xc0006b64d0, {0x1414d55f8, 0xc000600a50}) D:/a/mcpproxy-go/mcpproxy-go/internal/upstream/manager.go:1474 +0x1e8 ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed Windows test failures by adding context checks before logging in
startDockerRecoveryMonitor. This prevents goroutines from logging after test completion, completing the fix started in PR #122.Root Cause
On Windows (where Docker is typically not available in CI), the issue occurred when:
Close(), canceling the contextThis is different from the macOS/Linux issue fixed in PR #122, where the logging happened after a timer delay.
Changes
File:
internal/upstream/manager.goAdded context check in initial Docker availability check (line 1716-1721)
Added context check in periodic monitoring (line 1739-1744)
Test Results
✅ Tests pass locally with the fix applied
Fixes
Windows test failure:
Error:
Related PRs
Complements PR #122 which fixed the same issue on macOS/Linux platforms for timer-based logging.
🤖 Generated with Claude Code