Skip to content

Commit

Permalink
qmemman: make sure to release lock
Browse files Browse the repository at this point in the history
Even when handling updated meminfo or domain list something goes wrong,
make sure to release the lock - otherwise the whole qmemman will be
blocked.
  • Loading branch information
marmarek committed Jun 12, 2017
1 parent 9015414 commit 206b7c0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions qubes/tools/qmemmand.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,14 @@ def meminfo_changed(self, domain_id):
self.log.debug('acquiring global_lock')
global_lock.acquire()
self.log.debug('global_lock acquired')
if force_refresh_domain_list:
self.domain_list_changed(refresh_only=True)

system_state.refresh_meminfo(domain_id, untrusted_meminfo_key)
try:
if force_refresh_domain_list:
self.domain_list_changed(refresh_only=True)

global_lock.release()
self.log.debug('global_lock released')
system_state.refresh_meminfo(domain_id, untrusted_meminfo_key)
finally:
global_lock.release()
self.log.debug('global_lock released')


def watch_loop(self):
Expand Down

0 comments on commit 206b7c0

Please sign in to comment.