Skip to content

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

Closed
@m-lima

Description

@m-lima

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

Metadata

Metadata

Assignees

Labels

area/tunnelSupport for the tunnel commandkind/bugCategorizes issue or PR as related to a bug.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions