Skip to content

allow for optional started channel to receive runc pid#69

Merged
estesp merged 1 commit into
containerd:masterfrom
coryb:started-chan
Oct 20, 2020
Merged

allow for optional started channel to receive runc pid#69
estesp merged 1 commit into
containerd:masterfrom
coryb:started-chan

Conversation

@coryb
Copy link
Copy Markdown
Contributor

@coryb coryb commented Oct 17, 2020

We need to be able to send signals to the runc process (not the processes running under runc), and the Monitor currently does not allow for us to learn the pid in order to signal. This PR adds an optional Started chan<- int to the CreateOpts and ExecOpts to allow for us to receive the pid just after the runc process has started.

The use-case for sending signals directly to the runc process is that we need to send a SIGWINCH for resize events when using externally managed pty pair (not using ConsoleSocket). The current hacky work-around is to use PidFile, which will populate the pid of the runc init or exec process which we can then use to parse /proc/$pid/status to find the parent-pid (ie the runc process).

More context: moby/buildkit#1731 (comment)
cc @tonistiigi

@codecov-io
Copy link
Copy Markdown

codecov-io commented Oct 17, 2020

Codecov Report

Merging #69 into master will increase coverage by 1.37%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
+ Coverage   19.17%   20.54%   +1.37%     
==========================================
  Files           7        7              
  Lines         579      589      +10     
==========================================
+ Hits          111      121      +10     
  Misses        432      432              
  Partials       36       36              
Impacted Files Coverage Δ
runc.go 20.58% <66.66%> (+2.40%) ⬆️

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 8c4be61...159c1d6. Read the comment docs.

@tonistiigi
Copy link
Copy Markdown
Member

cc @estesp @AkihiroSuda

Comment thread runc_test.go Outdated
Started: started,
})
if err == nil {
t.Fatal("Expected error from Exec, but got nil")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/Exec/Run/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Whoops, thanks. Fixed.

Signed-off-by: Cory Bennett <cbennett@netflix.com>
Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 16b287b into containerd:master Oct 20, 2020
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