Skip to content

[18.09 backport] dial-stdio: handle connections which lack CloseRead method - #1733

Merged
tiborvass merged 2 commits into
docker:18.09from
thaJeztah:18.09_backport_dial_stdio_npipe_on_windows
Mar 21, 2019
Merged

[18.09 backport] dial-stdio: handle connections which lack CloseRead method#1733
tiborvass merged 2 commits into
docker:18.09from
thaJeztah:18.09_backport_dial_stdio_npipe_on_windows

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

backport of #1718 for 18.09 (omitting the "revert" commit (0449ad8), which is not needed for this branch)

Ian Campbell added 2 commits March 13, 2019 11:53
This happens on Windows when dialing a named pipe (a path which is used by CLI
plugins), in that case some debugging shows:
DEBU[0000] conn is a *winio.win32MessageBytePipe
DEBU[0000] conn is a halfReadCloser: false
DEBU[0000] conn is a halfWriteCloser: true
the raw stream connection does not implement halfCloser
In such cases we can simply wrap with a nop function since closing for read
isn't too critical.
Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 8919bbf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This was leaking the fd.
Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 186e745)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah

Copy link
Copy Markdown
MemberAuthor

@silvin-lubeckisilvin-lubecki 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

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #1733 into 18.09 will decrease coverage by 0.02%.
The diff coverage is 0%.

@@ Coverage Diff @@## 18.09 #1733 +/- ##
==========================================
- Coverage 54.09% 54.07% -0.03% 
==========================================
Files 290 290 Lines 19406 19414 +8 ==========================================
Hits 10498 10498 - Misses 8236 8244 +8 
Partials 672 672

1 similar comment
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #1733 into 18.09 will decrease coverage by 0.02%.
The diff coverage is 0%.

@@ Coverage Diff @@## 18.09 #1733 +/- ##
==========================================
- Coverage 54.09% 54.07% -0.03% 
==========================================
Files 290 290 Lines 19406 19414 +8 ==========================================
Hits 10498 10498 - Misses 8236 8244 +8 
Partials 672 672

@tiborvass
tiborvass merged commit f6693b0 into docker:18.09Mar 21, 2019
@thaJeztah
thaJeztah deleted the 18.09_backport_dial_stdio_npipe_on_windows branch March 21, 2019 21:52
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@thaJeztah@codecov-io@tiborvass@silvin-lubecki@GordonTheTurtle