/cli/command/container/hijack.go: fix tcp half-closed connection unreliability in WSL#4548
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4548 +/- ##
==========================================
- Coverage 59.68% 59.65% -0.04%
==========================================
Files 287 285 -2
Lines 24752 24751 -1
==========================================
- Hits 14774 14765 -9
- Misses 9092 9098 +6
- Partials 886 888 +2 |
|
I figured out the real reason of bug. It is not race-condition. |
|
Thanks! I asked a colleague who's more familiar with some of this to have a look (but they're on leave currently, so hope they get round to it). I did notice there's a typo in the commit message ( |
|
Oh sorry... Thanks for noticing. I will fix it in 15 hours. |
badf9be to
6af01b1
Compare
|
@laurazard are you able to help review this one? 🤗 |
Signed-off-by: Seongbin Hong <vertex@g.cnu.ac.kr>
6af01b1 to
2e01d90
Compare
|
Looks like this one dropped between the cracks. I did a quick rebase to get a run of CI, and will try to get reviewers |
Isn't the problem then that |
closes #3586
- What I did
I fixed tcp half-closed connection unreliability.
the problem occurs because of half-closeing hijacked socket. it makes tcp connection closed.
I experimented various of situation(windows<->ubuntu, windows<->hyper-v ubuntu, windows <-> hyper-v windows). but only windows -> WSL(linux) cannot make half-closed connection that is host to guest direction.
- How I did it
I moved h.resp.CloseWrite() to
func (h *hijackedIOStreamer) stream(ctx context.Context) errorfrom goroutine infunc (h *hijackedIOStreamer) beginInputStream(restoreInput func()) (doneC <-chan struct{}, detachedC <-chan error)It secures hijacked socket will send and receive all of data. so it prevents half-closed connection in attach sequence.
- How to verify it


before:
after:
- Description for the changelog
Fixed no output of docker run command over WSL 2 Docker context from Windows via tcp
- A picture of a cute animal (not mandatory but encouraged)