Skip to content

Fix socat bridge creation in docker-init.sh.tmpl - #83

Merged
Roemer merged 5 commits into
mainfrom
Roemer-patch-1
Nov 12, 2026
Merged

Roemer merged 5 commits into
mainfrom
Roemer-patch-1

Conversation

@Roemer

@Roemer Roemer commented Nov 11, 2026

Copy link
Copy Markdown
Member

Updated socat bridge creation to ensure proper socket connection order and background execution.

Updated socat bridge creation to ensure proper socket connection order and background execution.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The entrypoint can execute the requested command without a Docker socket bridge if socat fails, because the polling loop does not verify that the socket appeared.

1 open issue
What changed in this PR

This PR fixes Docker socket bridge startup in the Docker-out feature so socat can handle separate client connections without blocking the container command.

Changes:

  • Places the listening socket before the source connection in the socat arguments.
  • Runs socat in the background.
  • Adds bounded polling for the target socket before continuing.
File Description
features/​src/​docker-out/​docker-init.sh.tmpl Corrects socat address order, backgrounds the bridge, and adds socket readiness polling.

Review effort: Balanced

Add error handling for Docker socket readiness.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The socket pathname check can pass before socat starts listening, allowing the command to launch prematurely and encounter ECONNREFUSED.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Probe socket readiness before launching the command

features/​src/​docker-out/​docker-init.sh.tmpl:84

The socket path exists after bind(), before socat calls listen(), so this check can launch the command while connections still fail with ECONNREFUSED. A bound-but-not-listening UNIX socket passes this loop even though it refuses connections. Replace the pathname checks with a bounded connection-readiness probe against the target socket.

1 resolved since last review

Review effort: Balanced

Replace socket readiness check with connection probe using socat.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Identical socket overrides can cause the script to delete the source socket and create a self-referential listener that recursively spawns socat processes instead of reaching Docker.

1 open issue

Review effort: Balanced

Added error handling for SOURCE_SOCKET and TARGET_SOCKET conflict in docker-init.sh template.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the Docker-out socket bridge changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@eraserix eraserix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Roemer
Roemer merged commit dad20e2 into main Nov 12, 2026
42 checks passed
@Roemer
Roemer deleted the Roemer-patch-1 branch November 12, 2026 15:17
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.

3 participants