-
Notifications
You must be signed in to change notification settings - Fork 109
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
Fix undefined variable and warning message #134
Conversation
Add namespace test case for fdb related MIB. Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
functions. Multiple connect is causing an increase in run time causing agentx connection to close. Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
@@ -536,18 +544,18 @@ def update_rem_if_mgmt(self, if_oid, if_name): | |||
return | |||
self.if_range.sort() | |||
|
|||
def _update_per_namespace_data(self, db_conn, pubsub): |
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.
_update_per_namespace_data [](start = 8, length = 26)
Original code seems better. Why change? #Closed
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.
Before namespace changes, self.pubsub was getting updated in update_data(). After namespace change, self.pubsub array was not updated as we pass the instance. By passing the array index, we can ensure that the array is directly getting udpated. So this fix is to make sure the code is as it was before namespace changes.
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.
Updated description with the issue and why this fix is required.
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.
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.
Fixed as per comments.
redis_client = self.statedb[inst].get_redis_client(self.statedb[inst].STATE_DB) | ||
db = self.statedb[inst].get_dbid(self.statedb[inst].STATE_DB) | ||
self.pubsub[inst] = redis_client.pubsub() | ||
self.pubsub[inst].psubscribe("__keyspace@{}__:{}".format(db, self.TRANSCEIVER_KEY_PATTERN)) |
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.
Duplicated code. Could you reuse? #Closed
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.
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.
Fixed as per review comments.
@@ -104,6 +104,7 @@ def __init__(self): | |||
super().__init__() | |||
|
|||
self.db_conn = Namespace.init_namespace_dbs() | |||
Namespace.connect_all_dbs(self.db_conn, mibs.APPL_DB) |
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.
Namespace.connect_all_dbs(self.db_conn, mibs.APPL_DB) [](start = 8, length = 53)
Original code could tolerate temporary or initial Redis not offline and recover whenever online. But the new code could not. Can you improve and test?
#Closed
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.
I do see that if redis-server process is stopped and started, the MIB walk does not get affected, as the connect is persistent_connect. But, I have reverted this change, I will raise a new PR to provide a clean fix to reduce runtime.
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT", | ||
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000005", | ||
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "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.
If not related to the PR subject, could you submit another PR just for test cases? #Closed
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.
This test case is to test the code path where the undefined variable is fixed in this PR.
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.
As comments
This reverts commit 1dced6e.
not created everytime in update_data but is created only if the channel was not created previously. Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
* Fix errors introduced. Add namespace test case for fdb related MIB. * Make sure that db connections are done in MIB class init functions. Multiple connect is causing an increase in run time causing agentx connection to close. * Minor fix * Add mock asic_db. * Remove trailing whitespace. * Revert "Make sure that db connections are done in MIB class init" * Fix to make sure pubsub channel in LLDPRemManAddrUpdater is not created everytime in update_data but is created only if the channel was not created previously. * Fix as per review comments.
- What I did
- How I did it
- How to verify it
Make sure that warning messages are not seen in syslog.
- Description for the changelog