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

SSH tunnels left open after sending SIGINT to minikube tunnel #10752

Closed
m-lima opened this issue Mar 8, 2021 · 4 comments · Fixed by #11745
Closed

SSH tunnels left open after sending SIGINT to minikube tunnel #10752

m-lima opened this issue Mar 8, 2021 · 4 comments · Fixed by #11745
Assignees
Labels
area/tunnel Support for the tunnel command kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Milestone

Comments

@m-lima
Copy link

m-lima commented Mar 8, 2021

Steps to reproduce the issue:
Minikube running with docker driver on macOS Catalina

  1. minikube tunnel
  2. On another terminal: kill -INT <PID_OF_THE_PREVIOUS_COMMAND>
  3. ps aux | grep minikube

Full output of failed command:
The ps command will show multiple ssh tunnels still open, outliving the parent process.

Details
In pkg/minikube/tunnel/kic/ssh_tunnel.go the interrupt signal is caught and it stops the LoadBalancerEmulator. However, it assumes that the interrupt will also propagate to the children ssh tunnels, which are running in a goroutine inside startConnections.
The interrupt, however, kills the goroutine and the blocking call which waits for the child process to finish. This leaves the ssh tunnels dangling.
On the other hand, if CTRL + C is sent on the same terminal as minikube tunnel and the clean-up routine included killing all ssh tunnels, the OS would error with "process already finished".

Related issues
#8511
#3647

@sharifelgamal sharifelgamal added area/tunnel Support for the tunnel command kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Mar 9, 2021
@sharifelgamal
Copy link
Collaborator

Thanks for finding this and opening an issue. We should definitely fix this.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 7, 2021
@vishjain
Copy link
Contributor

/assign

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 19, 2021
@sharifelgamal sharifelgamal added this to the 1.23.0 milestone Jul 21, 2021
@spowelljr spowelljr added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tunnel Support for the tunnel command kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
6 participants