Skip to content

Improve error return from AnonDialer on Windows#3467

Merged
dmcgowan merged 2 commits intocontainerd:masterfrom
kevpar:dial-pipe-err
Aug 1, 2019
Merged

Improve error return from AnonDialer on Windows#3467
dmcgowan merged 2 commits intocontainerd:masterfrom
kevpar:dial-pipe-err

Conversation

@kevpar
Copy link
Copy Markdown
Member

@kevpar kevpar commented Jul 29, 2019

AnonDialer will now return a "not found" error if the pipe is not found
before the timeout is reached. If the pipe exists but the timeout is
reached while attempting to connect, the timeout error will still be
returned.

This will allow the error handling logic to work properly when
connecting to the shim log pipe. An error message is only logged if the
error is not "not found", so now log noise from log pipes that were
never intended to be created by the shim will be hidden.

This change also cleans up the control flow for AnonDialer on Windows.
The new code should be more easily readable, but the only semantic
change is the error return value change.

Signed-off-by: Kevin Parsons [email protected]

@kevpar
Copy link
Copy Markdown
Member Author

kevpar commented Jul 29, 2019

@jterry75 PTAL

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 29, 2019

Build succeeded.

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #3467 into master will increase coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3467      +/-   ##
==========================================
+ Coverage   44.24%   44.25%   +<.01%     
==========================================
  Files         124      124              
  Lines       13732    13730       -2     
==========================================
  Hits         6076     6076              
+ Misses       6725     6723       -2     
  Partials      931      931
Flag Coverage Δ
#linux 48.04% <ø> (ø) ⬆️
#windows 39.86% <0%> (ø) ⬆️
Impacted Files Coverage Δ
runtime/v2/shim/util_windows.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 172fe90...07c538d. Read the comment docs.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 29, 2019

Codecov Report

Merging #3467 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3467      +/-   ##
==========================================
- Coverage   44.24%   44.23%   -0.02%     
==========================================
  Files         124      124              
  Lines       13732    13737       +5     
==========================================
  Hits         6076     6076              
- Misses       6725     6730       +5     
  Partials      931      931
Flag Coverage Δ
#linux 48.04% <ø> (ø) ⬆️
#windows 39.84% <0%> (-0.02%) ⬇️
Impacted Files Coverage Δ
runtime/v2/shim/util_windows.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a49df98...b16e7c5. Read the comment docs.

Comment thread runtime/v2/shim/util_windows.go Outdated
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 30, 2019

Build succeeded.

Comment thread runtime/v2/shim/util_windows.go Outdated
@mxpv
Copy link
Copy Markdown
Member

mxpv commented Jul 30, 2019

AnonDialer will now return a "not found" error if the pipe is not found
before the timeout is reached. If the pipe exists but the timeout is
reached while attempting to connect, the timeout error will still be
returned.

This will allow the error handling logic to work properly when
connecting to the shim log pipe. An error message is only logged if the
error is not "not found", so now log noise from log pipes that were
never intended to be created by the shim will be hidden.

This change also cleans up the control flow for AnonDialer on Windows.
The new code should be more easily readable, but the only semantic
change is the error return value change.

Signed-off-by: Kevin Parsons <[email protected]>
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 31, 2019

Build succeeded.

Copy link
Copy Markdown
Contributor

@jterry75 jterry75 left a comment

Choose a reason for hiding this comment

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

Now thats some good looking code. LGTM

@kevpar
Copy link
Copy Markdown
Member Author

kevpar commented Jul 31, 2019

As @mxpv suggested, I have updated the pkg/ttrpcutil code (which was identical to AnonDialer) to the same improved logic. I think there is potential in the future to unify all of these implementations into a single one in pkg/dialer, but I think that is broader scope than this PR.

@kevpar
Copy link
Copy Markdown
Member Author

kevpar commented Jul 31, 2019

I filed #3471 to track merging the dialer implementations in the future.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 31, 2019

Build succeeded.

@kevpar
Copy link
Copy Markdown
Member Author

kevpar commented Aug 1, 2019

@dmcgowan Any other concerns with this?

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan dmcgowan merged commit ac1cb6d into containerd:master Aug 1, 2019
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.

5 participants