Remove local health port binding, check upstream directly, and fix Docker PR CI#5
Merged
Remove local health port binding, check upstream directly, and fix Docker PR CI#5
Conversation
Co-authored-by: tma <4719+tma@users.noreply.github.com>
Co-authored-by: tma <4719+tma@users.noreply.github.com>
Co-authored-by: tma <4719+tma@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix address already in use error for TCP socket
Remove local health port binding and make Mar 9, 2026
-health check upstream directly
tma
reviewed
Mar 9, 2026
Co-authored-by: tma <4719+tma@users.noreply.github.com>
Co-authored-by: tma <4719+tma@users.noreply.github.com>
tma
reviewed
Mar 10, 2026
Co-authored-by: tma <4719+tma@users.noreply.github.com>
Copilot
AI
changed the title
Remove local health port binding and make
Remove local health port binding, check upstream directly, and fix Docker PR CI
Mar 10, 2026
-health check upstream directly
tma
approved these changes
Mar 10, 2026
tma
added a commit
that referenced
this pull request
Mar 11, 2026
Revert the direct-upstream health probe introduced in #5, which opened a second TCP connection to the Modbus device on every check. Many Modbus devices only accept one concurrent connection, so the probe interfered with normal proxy operation in production. Restore the original passive HTTP health server that checks internal connection state without touching upstream. Make it opt-in via HEALTH_LISTEN so bare-binary users running multiple instances (the root cause of #4) no longer hit port conflicts. The Dockerfile sets HEALTH_LISTEN=:8080 so Docker users get health checks automatically. Closes #4
tma
added a commit
that referenced
this pull request
Mar 11, 2026
* fix: restore HTTP-based health server, make it opt-in Revert the direct-upstream health probe introduced in #5, which opened a second TCP connection to the Modbus device on every check. Many Modbus devices only accept one concurrent connection, so the probe interfered with normal proxy operation in production. Restore the original passive HTTP health server that checks internal connection state without touching upstream. Make it opt-in via HEALTH_LISTEN so bare-binary users running multiple instances (the root cause of #4) no longer hit port conflicts. The Dockerfile sets HEALTH_LISTEN=:8080 so Docker users get health checks automatically. Closes #4 * fix: normalize wildcard hosts in CheckHealth, isolate config test env Co-authored-by: tma <4719+tma@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
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.
This PR removes the separate local health listener and makes
mbproxy -healthverify upstream connectivity directly, then follows up on the resulting CI failure by fixing the Docker workflow used for pull requests.Changes Made
mbproxy -healthagainst the upstream connection directly.ghcr.io, which returned403 Forbidden./home/runner/work/mbproxy/mbproxy/.github/workflows/docker.ymlso the Docker workflow remains a single build step while using PR-safe cache behavior:mainand tag builds continue using registry-backed cache and publish to GHCRValidation
go fmt ./...go vet ./...go test -v -race ./...This keeps the original health-check behavior change intact while ensuring the PR Docker workflow no longer fails due to GHCR cache authorization during pull request builds.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.