Skip to content

Cleanup after restored shim dies unexpectedly#2083

Closed
mlaventure wants to merge 1 commit intocontainerd:masterfrom
mlaventure:cleanup-after-dead-orphan-shim
Closed

Cleanup after restored shim dies unexpectedly#2083
mlaventure wants to merge 1 commit intocontainerd:masterfrom
mlaventure:cleanup-after-dead-orphan-shim

Conversation

@mlaventure
Copy link
Copy Markdown
Contributor

Signed-off-by: Kenfe-Mickael Laventure [email protected]

--
Fixes #2078

Signed-off-by: Kenfe-Mickael Laventure <[email protected]>
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #2083 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2083   +/-   ##
=======================================
  Coverage   45.35%   45.35%           
=======================================
  Files          96       96           
  Lines        9453     9453           
=======================================
  Hits         4287     4287           
  Misses       4455     4455           
  Partials      711      711
Flag Coverage Δ
#linux 50.24% <ø> (ø) ⬆️
#windows 40.29% <ø> (ø) ⬆️

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 eed3b1c...6fe630f. Read the comment docs.

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; assume @cpuguy83 can validate fix with his repro?

@cpuguy83
Copy link
Copy Markdown
Member

cpuguy83 commented Feb 1, 2018

@estesp Yep, witholding my LGTM until I get a chance to test.

@stevvooe
Copy link
Copy Markdown
Member

stevvooe commented Feb 1, 2018

LGTM

Comment thread linux/runtime.go
go func() {
ctx = namespaces.WithNamespace(context.Background(), ns)
for {
_, err := s.Wait(ctx, &shim.WaitRequest{id})
Copy link
Copy Markdown
Member

@crosbymichael crosbymichael Feb 1, 2018

Choose a reason for hiding this comment

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

Instead of having a blocking connection for every shim, could we change ttprc to have a shutdown hook. ttrpcConn.OnShutdown(func() {}) that any call that gets an ErrClosed runs the shutdown function to cleanup the connection? @stevvooe

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.

I was thinking a goroutine + connection for every shim is heavy.

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.

Currently it's the only way I can see, unless we go with @crosbymichael suggestion, which would definitely be better on resources usage

Copy link
Copy Markdown
Member

@stevvooe stevvooe Feb 2, 2018

Choose a reason for hiding this comment

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

Looking closer, an OnShutdown method in ttrpc would help here, assuming we are tying everything to the lifecycle of the client, and not the connection. If we want better control over the connection lifecyle, we'll have to introduce a pool. In this case, we are clearly using the client lifecycle, so this change would work well.

@mlaventure mlaventure deleted the cleanup-after-dead-orphan-shim branch February 7, 2018 00:52
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.

6 participants