[write standby] force DB connections to use unix socket to connect (#14524)
Why I did it At service start up time, there are chances that the networking service is being restarted by interface-config service. When that happens, write_standby could fail to make DB connections due to loopback interface is being reconfigured. How I did it Force the db connector to use unix socket to avoid loopback reconfig timing window. How to verify it Run config reload test 20+ times and no issue encountered. Signed-off-by: Ying Xie <ying.xie@microsoft.com> * use unix socket instead Signed-off-by: Ying Xie <ying.xie@microsoft.com>
This commit is contained in:
parent
cffd87a627
commit
737d0e57ad
@ -37,7 +37,7 @@ class MuxStateWriter(object):
|
||||
Initializes the connector during the first call
|
||||
"""
|
||||
if self.config_db_connector is None:
|
||||
self.config_db_connector = ConfigDBConnector()
|
||||
self.config_db_connector = ConfigDBConnector(use_unix_socket_path=True)
|
||||
self.config_db_connector.connect()
|
||||
|
||||
return self.config_db_connector
|
||||
@ -69,7 +69,7 @@ class MuxStateWriter(object):
|
||||
Initializes the connector during the first call
|
||||
"""
|
||||
if self.asic_db_connector is None:
|
||||
self.asic_db_connector = SonicV2Connector()
|
||||
self.asic_db_connector = SonicV2Connector(use_unix_socket_path=True)
|
||||
self.asic_db_connector.connect('ASIC_DB')
|
||||
|
||||
return self.asic_db_connector
|
||||
|
Reference in New Issue
Block a user