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

SIGINT handling #1845

Merged
merged 1 commit into from
Apr 4, 2018
Merged

SIGINT handling #1845

merged 1 commit into from
Apr 4, 2018

Conversation

russjones
Copy link
Contributor

Problem

#1650 raised two issues with SIGINT handling of tsh. The first is that Ctrl-C does not work when network connectivity is down. The second is that Ctrl-C does not work when running a command against multiple nodes (like tailing log files).

Implementation

  • Propagate the cancelation context to ConnectToProxy where it should try to connect to the proxy in another goroutine and exit early if the context has been canceled.
  • When running a command on multiple servers, close the connection and kill the client if SIGINT if the context has been canceled.

Related Issues

Fixes #1650


select {
// ConnectToProxy returned a result, return that back to the caller.
case <-connectContext.Done():
Copy link
Contributor

Choose a reason for hiding this comment

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

I remember I left a comment earlier today about merging parent context and this one, but disregard it, your code is actually correct and my suggestion will not work.

@russjones russjones merged commit 7485c11 into master Apr 4, 2018
@russjones russjones deleted the rjones/sigint-handling branch April 4, 2018 18:11
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.

ctrl-c ignored.
2 participants