Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NewDirectIOWithTerminal #2310

Merged
merged 1 commit into from Apr 25, 2018

Conversation

ehazlett
Copy link
Member

This adds NewDirectIOWithTerminal as well as a test for PTY (TestContainerPTY) to test that output has control codes.

Refs: #2307

@dmcgowan
Copy link
Member

LGTM


<-status

out := buf.String()
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs a direct.Wait() or close to fix the race. You can test locally with go test -c -race

@dmcgowan
Copy link
Member

The tests failed with a data race, but not quite sure I understand what is racing though. Restarted but captured the race stack in this gist https://gist.github.com/dmcgowan/674b2dd6c3dfcce3fe54b565f5ce1ba2

@crosbymichael
Copy link
Member

@dmcgowan io will race if you try to read from the buffer if the process hasn't finished flushing

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
@ehazlett
Copy link
Member Author

@dmcgowan thanks for the gist. i've updated to fix the race. thx!

@codecov-io
Copy link

codecov-io commented Apr 25, 2018

Codecov Report

Merging #2310 into master will decrease coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2310      +/-   ##
==========================================
- Coverage   45.54%   45.51%   -0.03%     
==========================================
  Files          83       83              
  Lines        9185     9190       +5     
==========================================
  Hits         4183     4183              
- Misses       4326     4331       +5     
  Partials      676      676
Flag Coverage Δ
#linux 50.04% <0%> (-0.04%) ⬇️
#windows 41.24% <ø> (ø) ⬆️
Impacted Files Coverage Δ
cio/io_unix.go 70.65% <0%> (-4.07%) ⬇️

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 1a5e0df...6b4355d. Read the comment docs.

@crosbymichael
Copy link
Member

LGTM

@crosbymichael crosbymichael merged commit a70e26c into containerd:master Apr 25, 2018
@dmcgowan
Copy link
Member

dmcgowan commented Jun 1, 2018

Found this PR introduces a bug. Clients which were calling NewDirectIO before and had Terminal set correctly, will not have Terminal overwritten to false. The solution would be have NewDirectIO use the Terminal value instead of false, or get rid of the WithTerminal option have the caller set the fifo Terminal value before calling NewDirectIO

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.

None yet

4 participants