Add heartbeat / automatic server cleanup code

This replaces the previous method of attempting to clean up servers when
an unexpected exit occurs in the client (e.g. SIGINT or panic) by a
heartbeat protocol.  If the server does not hear from the connecting
client within a certain interval of time (500ms in this commit), it will
de-activate itself.  This prevents dangling Docker Machine server
processes from accumulating.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire
2015-10-21 20:38:01 -07:00
parent a1e610bdd3
commit 76c7accda0
8 changed files with 83 additions and 104 deletions

View File

@@ -106,7 +106,7 @@ func TestExecServer(t *testing.T) {
stopCh: make(chan bool, 1),
}
finalErr := make(chan error, 1)
finalErr := make(chan error)
// Start the docker-machine-foo plugin server
go func() {