Skip to content

[ycabled] move swsscommon API's from subroutines to call them exactly once per task_worker/thread#310

Merged
vdahiya12 merged 5 commits intosonic-net:202012from
vdahiya12:fix-r-202012
Nov 7, 2022
Merged

[ycabled] move swsscommon API's from subroutines to call them exactly once per task_worker/thread#310
vdahiya12 merged 5 commits intosonic-net:202012from
vdahiya12:fix-r-202012

Conversation

@vdahiya12
Copy link
Copy Markdown
Contributor

@vdahiya12 vdahiya12 commented Nov 1, 2022

This PR attempts for ycabled to have all
swsscommon.Table and daemon_base.db_connect
as just a single call in the thread instance for all task_workers

For example all swsscommon calls to open Tables are moved as class object varables, which are reused when needed instead of opening the Table again in subroutines.

self.config_db[asic_id] = daemon_base.db_connect("CONFIG_DB", namespace)

This would help in avoiding unforeseen redis-errors
Signed-off-by: vaibhav-dahiya [email protected]

Description

Motivation and Context

How Has This Been Tested?

Deploying changes on testbed and UT

Additional Information (Optional)

once per task_worker/thread

Signed-off-by: vaibhav-dahiya <[email protected]>
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Nov 1, 2022

This pull request introduces 1 alert when merging 294ecb5 into aacb772 - view on LGTM.com

new alerts:

  • 1 for Syntax error

Signed-off-by: vaibhav-dahiya <[email protected]>
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Nov 1, 2022

This pull request introduces 1 alert when merging c055d3a into aacb772 - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a call

Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
@prgeor prgeor added the Y-Cable label Nov 1, 2022
@prgeor prgeor self-requested a review November 1, 2022 23:15
@prgeor
Copy link
Copy Markdown
Collaborator

prgeor commented Nov 2, 2022

@vdahiya12 can you attach the test results for sonic-mgmt test pass?

@vdahiya12
Copy link
Copy Markdown
Contributor Author

@vdahiya12 can you attach the test results for sonic-mgmt test pass?

updated in combined PR

#312

@vdahiya12 vdahiya12 merged commit 3d5470d into sonic-net:202012 Nov 7, 2022
@vdahiya12 vdahiya12 deleted the fix-r-202012 branch November 7, 2022 18:19
lotus-nexthop pushed a commit to lotus-nexthop/sonic-platform-daemons that referenced this pull request Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants