I am writing a plugin for Ida (in python) that utilizes the Etcd remote key value storage system. My problem is that when I attempt to get a lock on the server
lock = etcd.Lock(self.client, 'ida_lock')
Should timeout after 30 seconds. Hopefully that is enough.
lock.acquire(blocking=True,lock_ttl=None,timeout=30)
if lock.is_acquired:
data,idc_file = self.get_idc_data()
if os.path.isfile('expendable.idc'):
self.client.write('/fREd/' + self.md5 + '/all/', idc_file, prevValue = open('expendable.idc','r').readlines())
else:
self.client.write('/fREd/' + self.md5 + '/all/', idc_file)
lock.release()
like so, Ida freezes and I was wondering if anyone had any insight on why this is happening or how to fix it.
So for reference the method that includes this is called via a keyboard shortcut
idaapi.add_hotkey('Ctrl-.', self.push_data)
and there is no doubt that it is the lock that causes the problem.
You can look at the python-etcd source at https://github.com/jplana/python-etcd