aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-01-22 14:19:54 -0800
committerMartin Braun <martin.braun@ettus.com>2018-01-22 15:36:13 -0800
commitf83f6fb46406572ac137ccbf1881561e20606d52 (patch)
treec6472e41e6e98fcdf3ea513e9ca29dc13aced591
parentc4080003f54c6fe1b5fd19edd23f8cd5f9a9f79a (diff)
downloaduhd-f83f6fb46406572ac137ccbf1881561e20606d52.tar.gz
uhd-f83f6fb46406572ac137ccbf1881561e20606d52.tar.bz2
uhd-f83f6fb46406572ac137ccbf1881561e20606d52.zip
mpm: Log timeouts during API calls, reset timer on claimed calls
Reviewed-by: Trung Tran <trung.tran@ettus.com>
-rw-r--r--mpm/python/usrp_mpm/rpc_server.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py
index 650997e46..d20796c52 100644
--- a/mpm/python/usrp_mpm/rpc_server.py
+++ b/mpm/python/usrp_mpm/rpc_server.py
@@ -174,6 +174,9 @@ class MPMServer(RPCServer):
)
raise RuntimeError("Invalid token!")
try:
+ # Because we can only reach this point with a valid claim,
+ # there's no harm in resetting the timer
+ self._reset_timer()
return function(*args)
except Exception as ex:
self.log.error(
@@ -182,6 +185,10 @@ class MPMServer(RPCServer):
)
self._last_error = str(ex)
raise
+ finally:
+ if not self.periph_manager.claimed:
+ self.log.error("Lost claim during API call to `%s'!",
+ command)
new_claimed_function.__doc__ = function.__doc__
setattr(self, command, new_claimed_function)