-
Notifications
You must be signed in to change notification settings - Fork 205
Open
Description
DOM_INFO_UPDATE_PERIOD_SECS should be the time delay between polling information from a specified interface, say Ethernet0
So the expectation is:
Polled Ethernet0 @ t=0
Polled Ethernet4 @ t = ...
...
Polled Ethernet200 @ t = X
Polled Ethernet0 @ t=DOM_INFO_UPDATE_PERIOD_SECS
Instead what we see is:
Polled Ethernet0 @ t=0
Polled Ethernet4 @ t = ...
...
Polled Ethernet200 @ t = X
Polled Ethernet0 @ t=X+DOM_INFO_UPDATE_PERIOD_SECS
This means no information is polled from any transceiver for DOM_INFO_UPDATE_PERIOD_SECS after the polling loop completes, even though more time than DOM_INFO_UPDATE_PERIOD_SECS may have elapsed since Ethernet0 was polled.
This is due to the following code:
class DomInfoUpdateBase(threading.Thread):
...
def task_worker(self):
...
# Start loop to update dom info in DB periodically and handle port change events
while not self.task_stopping_event.is_set():
# Check if periodic db update is needed
if next_periodic_db_update_time <= datetime.datetime.now():
is_periodic_db_update_needed = True
...
for physical_port, logical_ports in self.port_mapping.physical_to_logical.items():
...
if is_periodic_db_update_needed:
next_periodic_db_update_time = datetime.datetime.now() + \ <<===============
datetime.timedelta(seconds=dom_info_update_periodic_secs)
is_periodic_db_update_needed = False
In order to enforce proper timing delay, now should be set at the start of the loop and used at the highlighted place to set next_periodic_db_update_time
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels