Skip to content

Commit

Permalink
[show][muxcable] increase timeout for displaying HW_STATUS (#2712)
Browse files Browse the repository at this point in the history
What I did
probe mux direction not always return success.

Sample output of: while [ 1 ]; do date; show mux hwmode muxdirection; show mux status; sleep 1; done

Mon 27 Feb 2023 03:12:25 PM UTC
Port         Direction    Presence
-----------  -----------  ----------
Ethernet16   unknown      True

PORT         STATUS    HEALTH    HWSTATUS      LAST_SWITCHOVER_TIME
-----------  --------  --------  ------------  ---------------------------
Ethernet16   standby   healthy   inconsistent  2023-Feb-25 07:55:18.269177
If we increase the timeout to 0.5 secs to get the values back from ycabled, this will remove the inconsistency issue, and display the consistent values, because while telemetry is going on, the time to get actual mux value takes significantly longer than 0.1 seconds.

PORT         STATUS    HEALTH    HWSTATUS      LAST_SWITCHOVER_TIME
-----------  --------  --------  ------------  ---------------------------
Ethernet16   standby   healthy   consistent  2023-Feb-25 07:55:18.269177
How I did it
How to verify it
Manually run changes on setup
worst-case CLI return time could be 16 seconds for 32 ports. on avg each port is 200 mSec if telemetry is going, but on average show command will return in < 1 sec for all 32 ports.

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
  • Loading branch information
vdahiya12 authored and StormLiangMS committed Mar 19, 2023
1 parent 1e2dbfc commit 7324470
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion show/muxcable.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

REDIS_TIMEOUT_MSECS = 0
SELECT_TIMEOUT = 1000
HWMODE_MUXDIRECTION_TIMEOUT = 0.1
HWMODE_MUXDIRECTION_TIMEOUT = 0.5

# The empty namespace refers to linux host namespace.
EMPTY_NAMESPACE = ''
Expand Down

0 comments on commit 7324470

Please sign in to comment.