Fix memory leak in health check 59/34159/2
authorVladimir Lavor <vlavor@cisco.com>
Tue, 19 Oct 2021 10:17:15 +0000 (12:17 +0200)
committerVladimir Lavor <vlavor@cisco.com>
Tue, 19 Oct 2021 10:51:40 +0000 (12:51 +0200)
commit4cc53fc9a836df099dde983d506eb892dc2fdef1
treefb940798b16e08008a2624ce8d2a10cd225148d8
parent385ccc0d8ba929f39881efb7784bfb0921044ae8
Fix memory leak in health check

1. On connection disconnect, health check loop ends immediately
   and independently on probe interval setup
2. Proper resource cleanup

On disconnect, health check terminates itself with a delay based
on the probe interval. It causes memory usage going up if
AsyncConnect() & Disconnect() are called in a loop.

Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
Change-Id: Ibcdfec9d2d7736f9390e21039d9a917228114273
core/connection.go