From 8063697d68b935af6f981de666674f9621a56002 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 12 Jul 2017 16:50:31 -0700 Subject: mpm: Check rpc server has matching lock release/acquires --- mpm/python/usrp_mpm/rpc_server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mpm/python') diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py index 982e94c91..2f21edbee 100644 --- a/mpm/python/usrp_mpm/rpc_server.py +++ b/mpm/python/usrp_mpm/rpc_server.py @@ -159,6 +159,7 @@ class MPMServer(RPCServer): self._state.lock.acquire() if self._state.claim_status.value: self.log.warning("Someone tried to claim this device again") + self._state.lock.release() raise RuntimeError("Double-claim") self.log.debug( "Claiming from: %s, Session ID: %s", @@ -204,8 +205,8 @@ class MPMServer(RPCServer): if the device is claimed and the token doesn't match. Or if the device is not claimed at all. """ - self._state.lock.acquire() if self._state.claim_status.value: + self._state.lock.acquire() if self._check_token_valid(token): self._state.lock.release() self.log.debug("reclaimed from: %s", self.client_host) -- cgit v1.2.3