From b24ff24da9d1dab962b7590b6324a2135ae46a26 Mon Sep 17 00:00:00 2001 From: Vladislav Grishenko Date: Sat, 13 Mar 2021 15:17:03 +0500 Subject: api: fix rx timeout thread busy loop after reconnect After memclnt api client disconnect, read timeout is set to zero and stays the same even after same client reconnect. It causes client process to spin in timeout loop up to 100% cpu. Fix it by resetting timeout process state upon every (re)connect. Type: fix Signed-off-by: Vladislav Grishenko Change-Id: I56812972a69c343f869eebbdfebdcbefd3d201e0 --- src/vpp-api/client/client.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/vpp-api') diff --git a/src/vpp-api/client/client.c b/src/vpp-api/client/client.c index 7a30792402c..d59273ed6cb 100644 --- a/src/vpp-api/client/client.c +++ b/src/vpp-api/client/client.c @@ -305,6 +305,8 @@ vac_connect (char * name, char * chroot_prefix, vac_callback_t cb, } /* Start read timeout thread */ + timeout_in_progress = false; + timeout_thread_cancelled = false; rv = pthread_create(&pm->timeout_thread_handle, NULL, vac_timeout_thread_fn, 0); if (rv) { -- cgit 1.2.3-korg