Skip to content

Commit a6ae218

Browse files
author
maksymbelei95
authored
[vrf]: Fix freezing during interface binding (sonic-net#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 <[email protected]>
1 parent 2e1f354 commit a6ae218

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

config/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3079,7 +3079,7 @@ def bind(ctx, interface_name, vrf_name):
30793079
state_db = SonicV2Connector(use_unix_socket_path=True, namespace=ctx.obj['namespace'])
30803080
state_db.connect(state_db.STATE_DB, False)
30813081
_hash = '{}{}'.format('INTERFACE_TABLE|', interface_name)
3082-
while state_db.get_all(state_db.STATE_DB, _hash) != None:
3082+
while state_db.exists(state_db.STATE_DB, _hash):
30833083
time.sleep(0.01)
30843084
state_db.close(state_db.STATE_DB)
30853085
config_db.set_entry(table_name, interface_name, {"vrf_name": vrf_name})

0 commit comments

Comments
 (0)