From a6ae218238e7e552f49191f81451bd55ff56ba51 Mon Sep 17 00:00:00 2001 From: maksymbelei95 <75987222+maksymbelei95@users.noreply.github.com> Date: Tue, 2 Feb 2021 07:08:26 +0200 Subject: [PATCH] [vrf]: Fix freezing during interface binding (#1325) * Replacing using 'get_all' with 'exists' in port state checking procedure inside bind function to avoid freezing in the while loop, what caused by absence of related record in STATE_DB. Signed-off-by: Maksym Belei --- config/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/main.py b/config/main.py index 0e067854d8ab..3ad1e317a165 100644 --- a/config/main.py +++ b/config/main.py @@ -3079,7 +3079,7 @@ def bind(ctx, interface_name, vrf_name): state_db = SonicV2Connector(use_unix_socket_path=True, namespace=ctx.obj['namespace']) state_db.connect(state_db.STATE_DB, False) _hash = '{}{}'.format('INTERFACE_TABLE|', interface_name) - while state_db.get_all(state_db.STATE_DB, _hash) != None: + while state_db.exists(state_db.STATE_DB, _hash): time.sleep(0.01) state_db.close(state_db.STATE_DB) config_db.set_entry(table_name, interface_name, {"vrf_name": vrf_name})