-
Notifications
You must be signed in to change notification settings - Fork 2.3k
performance improvement: setup signal notify in a new go routine #4654
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,7 +246,7 @@ func (r *runner) run(config *specs.Process) (int, error) { | |
| // Setting up IO is a two stage process. We need to modify process to deal | ||
| // with detaching containers, and then we get a tty after the container has | ||
| // started. | ||
| handler := newSignalHandler(r.enableSubreaper, r.notifySocket) | ||
| handlerCh := newSignalHandler(r.enableSubreaper, r.notifySocket) | ||
| tty, err := setupIO(process, r.container, config.Terminal, detach, r.consoleSocket) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you see if doing
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I test these two paths, both of them spend only several milliseconds on doing the setup tasks.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough. Thanks! |
||
| if err != nil { | ||
| return -1, err | ||
|
|
@@ -285,6 +285,7 @@ func (r *runner) run(config *specs.Process) (int, error) { | |
| return -1, err | ||
| } | ||
| } | ||
| handler := <-handlerCh | ||
| status, err := handler.forward(process, tty, detach) | ||
| if err != nil { | ||
| r.terminate(process) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.