summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaw Loeung <[email protected]>2024-11-14 15:53:19 +1100
committerHaw Loeung <[email protected]>2024-11-14 16:05:20 +1100
commitb4793474c5194c9306ca3554caa2848a5426c31c (patch)
treea834029a241bfb70b77bffb82ebf779204806a73
parent1c25fcee63a3df3b6936782f92b4689336fc0401 (diff)
Continue onto next congestion control algorithm in preference list on failure
-rw-r--r--lib/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/utils.py b/lib/utils.py
index a04107d..e4ac33f 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -236,7 +236,10 @@ def select_tcp_congestion_control(preferred_tcp_cc, tcp_avail_path=_SYSCTL_NET_I
# We need to try set the TCP congestion control algorithm and
# see if it's successfully set.
cmd = ['sysctl', 'net.ipv4.tcp_congestion_control={}'.format(pref_cc)]
- subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ try:
+ subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ except subprocess.CalledProcessError:
+ continue
# Now check to see if it's set in '/proc/sys/net/ipv4/tcp_congestion_control'
# and use if so.