Handle forced connection closed by remote host error on Windows in release/1.1 branch
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start in client.go at the connection-closed error handling referenced in the issue, and review TestClientEOF in server_test.go. Check the platform-error approach using golang.org/x/sys and enable or run the Windows test; done means TestClientEOF passes on Windows and the client reports ErrClosed.
Written by the indexing model from the issue text.
Description
Problem
When enabling CI on Windows for release/1.1 branch (#163), an edge case was found via unit tests when running on the latest Windows platform with Go 1.20+ toolchain.
=== RUN TestOversizeCall
--- PASS: TestOversizeCall (0.03s)
=== RUN TestClientEOF
server_test.go:365: expected to have a cause of ErrClosed, got read unix @->TestClientEOF: wsarecv: An existing connection was forcibly closed by the remote host.
--- FAIL: TestClientEOF (0.00s)
=== RUN TestServerRequestTimeout
--- PASS: TestServerRequestTimeout (0.01s)
=== RUN TestServerConnectionsLeak
--- PASS: TestServerConnectionsLeak (0.10s)
=== RUN Test_MethodFullNameGeneration
--- PASS: Test_MethodFullNameGeneration (0.00s)
FAIL
github.com/containerd/ttrpc coverage: 76.3% of statements
FAIL github.com/containerd/ttrpc 1.696s
? github.com/containerd/ttrpc/cmd/protoc-gen-gogottrpc [no test files]
? github.com/containerd/ttrpc/example [no test files]
? github.com/containerd/ttrpc/example/cmd [no test files]
? github.com/containerd/ttrpc/plugin [no test files]
FAIL
The root cause is client not able to filter the connection closed by server error on Windows platform with the updated toolchain.
Ref: https://github.com/containerd/ttrpc/blob/20c493e60193d417ec0c6e795a4dcb8f25221f7d/client.go#L385
The impact is the client error does not get set to ErrClosed as expected.
Ref: https://github.com/containerd/ttrpc/blob/20c493e60193d417ec0c6e795a4dcb8f25221f7d/client.go#L38
Recommended Solution
The recommended solution would be to filter the error based on platform error using golang.org/x/sys package.
The solution should enable testing on Windows platform and existing TestClientEOF test should be sufficient to determine if issue is resolved.
Alternative solutions considered
Filter io.ErrClosedPIpe (Not viable)
This solution was to filter error closed on io.ErrClosedPipe.
Ref: https://github.com/containerd/ttrpc/blame/4a2816be9b4843f2cf40f1e533e7830d23f4489b/client.go#L450
Opened #165 and found this approach did not resolve the issue.
Filter based on error string
This solution would filter error closed based on the error string.
- Dominant language
- Go
- Stars
- 674
- Forks
- 90
- Avg merge
- 16h 32m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from containerd/ttrpc
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
containerd/ttrpc#258 ·
-
Occasional streamHandler map memory leakMay be free again @fuweid claimed this 175 days ago, and no pull request is open. Open
containerd/ttrpc#236 · 1 reaction · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
containerd/ttrpc#212 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
containerd/ttrpc#203 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
containerd/ttrpc#184 · 9 comments ·
All issues in containerd/ttrpc
Similar issues
-
ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
jordansmall/spindrift#7895 ·
Maintainers usually reply within 1 day
-
documentation priority: medium skill: intermediate status: ready for dev
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
hyperledger-labs/fabric-smart-client#2830 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
P3 tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day