From f83f6fb46406572ac137ccbf1881561e20606d52 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 22 Jan 2018 14:19:54 -0800 Subject: mpm: Log timeouts during API calls, reset timer on claimed calls Reviewed-by: Trung Tran --- mpm/python/usrp_mpm/rpc_server.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mpm/python/usrp_mpm') 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) -- cgit v1.2.3