Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Nov 7, 2022

Conversation

vdahiya12
Copy link
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 vdahiya@microsoft.com

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 <vdahiya@microsoft.com>
@lgtm-com
Copy link

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 <vdahiya@microsoft.com>
@lgtm-com
Copy link

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 <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@prgeor prgeor added the Y-Cable label Nov 1, 2022
@prgeor prgeor self-requested a review November 1, 2022 23:15
@prgeor
Copy link
Collaborator

prgeor commented Nov 2, 2022

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

@vdahiya12
Copy link
Contributor Author

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

updated in combined PR

#312

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