sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
718 stars 1.38k forks source link

When configure route by frr mgmt-frmework, there is a error log output of frrcfgd.py when init switch #13109

Open AlanYoush opened 1 year ago

AlanYoush commented 1 year ago

Description

def listen(self):
    """Start listen Redis keyspace events and will trigger corresponding handlers when content of a table changes.
    """
    self.pubsub = self.get_redis_client(self.db_name).pubsub()
    self.pubsub.psubscribe(**{"__keyspace@{}__:*".format(self.get_dbid(self.db_name)): self.sub_msg_handler})
    self.sub_thread = self.pubsub.run_in_thread(sleep_time = 0.01)

I find that function "self.pubsub.psubscribe()" return error of getting unexpected arguments. Because pubsub.psubscribe() is defined in swsscommon.swsscommon rather than swsssdk. The argument of pubsub.psubscribe() in swsscommon.swsscommon is "string &pattern"

Steps to reproduce the issue:

  1. init switch when device is running image

Describe the results you received:

  1. Failed to configure route by frr mgmt-framework

Describe the results you expected:

  1. Configure route by frr mgmt-framework successfully

Output of show version:

Master Version

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

adyeung commented 1 year ago

Reassign to DELL team as discussed offline

mhampasagar commented 1 year ago

looks like this issue came from this commit, @liuh-80 can you please check it. https://github.com/sonic-net/sonic-buildimage/pull/11215

liuh-80 commented 1 year ago

@mhampasagar , swsssdk been deprecated. This issue caused by a API gap between swss-common and redis-py: In swss-common: https://github.com/sonic-net/sonic-swss-common/blob/2247dbea47f968411b28b5c04d4be89d72d08cbf/common/pubsub.h void psubscribe(const std::string &pattern);

In redis-py: https://github.com/redis/redis-py/blob/a94772848db87bfc2c3cee20d8ca8b257fc37466/redis/asyncio/client.py async def psubscribe(self, *args: ChannelT, **kwargs: PubSubHandler):

I will create a PR to fix this and similar issue ASAP.

liuh-80 commented 1 year ago

Fix PR created: https://github.com/sonic-net/sonic-buildimage/pull/13836

liuh-80 commented 1 year ago

@jeff-yin, could you please review the fix for this issue? https://github.com/sonic-net/sonic-buildimage/pull/13836