mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-01-23 01:21:31 +01:00
ofctl_v1_0/2/3: check lock timeout by lock.is_set().
send_stats_request never catches hub.Timeout exception because it has been caught by the event wait function itself. Signed-off-by: Wei-Li Tang <alextwl@xinguard.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
39f06bff87
commit
bcc2c13484
@ -201,9 +201,8 @@ def send_stats_request(dp, stats, waiters, msgs):
|
||||
waiters_per_dp[stats.xid] = (lock, msgs)
|
||||
dp.send_msg(stats)
|
||||
|
||||
try:
|
||||
lock.wait(timeout=DEFAULT_TIMEOUT)
|
||||
except hub.Timeout:
|
||||
lock.wait(timeout=DEFAULT_TIMEOUT)
|
||||
if not lock.is_set():
|
||||
del waiters_per_dp[stats.xid]
|
||||
|
||||
|
||||
|
||||
@ -543,9 +543,8 @@ def send_stats_request(dp, stats, waiters, msgs):
|
||||
waiters_per_dp[stats.xid] = (lock, msgs)
|
||||
dp.send_msg(stats)
|
||||
|
||||
try:
|
||||
lock.wait(timeout=DEFAULT_TIMEOUT)
|
||||
except hub.Timeout:
|
||||
lock.wait(timeout=DEFAULT_TIMEOUT)
|
||||
if not lock.is_set():
|
||||
del waiters_per_dp[stats.xid]
|
||||
|
||||
|
||||
|
||||
@ -571,9 +571,8 @@ def send_stats_request(dp, stats, waiters, msgs):
|
||||
waiters_per_dp[stats.xid] = (lock, msgs)
|
||||
dp.send_msg(stats)
|
||||
|
||||
try:
|
||||
lock.wait(timeout=DEFAULT_TIMEOUT)
|
||||
except hub.Timeout:
|
||||
lock.wait(timeout=DEFAULT_TIMEOUT)
|
||||
if not lock.is_set():
|
||||
del waiters_per_dp[stats.xid]
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user