Skip to content

fix: prevent indefinite blocking in IPC handshake (#405)#641

Open
Aditya-Pan-pro wants to merge 1 commit intourunc-dev:mainfrom
Aditya-Pan-pro:fix-ipc-handshake-405
Open

fix: prevent indefinite blocking in IPC handshake (#405)#641
Aditya-Pan-pro wants to merge 1 commit intourunc-dev:mainfrom
Aditya-Pan-pro:fix-ipc-handshake-405

Conversation

@Aditya-Pan-pro
Copy link
Copy Markdown

Description

This PR implements enforced timeouts and atomic I/O operations for the IPC handshake.

  • Asymmetric Deadlines: Added a 10s timeout for the listener (AwaitMessage) and a 5s backoff/retry loop for the client (SendIPCMessage) to prevent the runtime from hanging indefinitely.
  • Atomic Messaging: Integrated io.ReadFull to ensure complete message delivery and prevent partial-read bugs.
  • Error Clarity: Added explicit checks for net.Error timeouts to provide clear logging during failures.

Related issues

How was this tested?

Manual testing was performed on Linux Mint 22.2 using custom Go test scripts and netcat:

  • Listener Timeout: Verified AwaitMessage triggers a timeout after 10s when no connection is received.
  • Client Timeout: Verified SendIPCMessage retries for 5s and fails when the socket is unavailable.
  • Success Path: Verified a successful handshake by sending an "INIT" message via netcat, confirming io.ReadFull works as intended.

Note

I do not have the full e2e environment set up locally, so I am relying on the CI for the final integration check.

LLM usage

Assisted by Gemini 3 Flash for logic refinement, structuring the testing methodology, and drafting the technical documentation/PR description. All code was manually verified and tested locally.

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

Signed-off-by: ADITYA PAN <adityapan.abcd@gmail.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 18b6b95
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/69fc763a078d430008fdfe58

@cmainas
Copy link
Copy Markdown
Contributor

cmainas commented May 7, 2026

The #405 issue has not been verified. Please do not open PRs for issues that have not been verified.

@cmainas cmainas added invalid This doesn't seem right do-not-merge labels May 7, 2026
@Aditya-Pan-pro
Copy link
Copy Markdown
Author

Sorry for submitting the code before the issue was officially approved. I will hold off on this PR for now. Please let me know if there are any logs or reproduction steps I can provide in issue #405 to help get it verified!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IPC handshake can block indefinitely during container startup

2 participants