-
Notifications
You must be signed in to change notification settings - Fork 88
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
[MultiDB] SonicV2Connector class use DBInterface class as member instead of inheritance #74
Conversation
@rajendra-dendukuri @qiluo-msft Please help review |
Test When stop all dockers , retry connect until database is restarted and set/get works fine
|
src/swsssdk/interface.py
Outdated
time.sleep(self.CONNECT_RETRY_WAIT_TIME) | ||
self.connect(db_id, True) | ||
self._connect(db_id, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_connect [](start = 13, length = 8)
We need to fix SonicV2Connector. There is nothing wrong in DBInterface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use composition instead and only change SonicV2Connector wrapper.
ac457fb
to
4391266
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified the patch and it looks good. |
@qiluo-msft , @dzhangalibaba is there a plan to merge this to 201911 branch? |
Yes. Added the label. |
issue : Exception seen when trying to connect and database service is not responding #72
the root cause is : SonicV2Connector connect(dbname) calls base class method connect(dbid), while when connection failed and retry, base class try to call self. connect() which is onicV2Connector connect(dbname) since name are the same. It should call its own connect(dbid).
for multiDB, we use methods from SonicV2Connector instead of DBInterface based on earlier changes
we should make sure DBInterface class method uses its own methods inside, hence making DBInterface class as a member of SonicV2Connector instead of inheritance
Signed-off-by: Dong Zhang [email protected]