Wago (beacon) lock timeout
With a Wago exported in two sessions eh2_exp
and eh2_optics
, the Wago works from eh2_exp
and timeouts on a beacon lock when used from eh2_optics
:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/blissadm/local/id10.git/id10/controllers/eh2_attenuators.py", line 307, in set
(currmask,currpos) = self.get()
File "/home/blissadm/local/id10.git/id10/controllers/eh2_attenuators.py", line 222, in get
inpos = self._wago_get(self.stat_id[0])
File "/home/blissadm/local/id10.git/id10/controllers/eh2_attenuators.py", line 380, in _wago_get
return [int(i) for i in self.wago.get(channel)]
File "/home/blissadm/local/bliss.git/bliss/config/conductor/client.py", line 84, in func
with Lock(self, **params):
File "/home/blissadm/local/bliss.git/bliss/config/conductor/client.py", line 66, in __enter__
lock(*self._devices, **self._params)
File "/home/blissadm/local/bliss.git/bliss/config/conductor/client.py", line 50, in f
return func(*args, **keys)
File "/home/blissadm/local/bliss.git/bliss/config/conductor/client.py", line 95, in lock
params["connection"].lock(*devices_name, **params)
File "/home/blissadm/local/bliss.git/bliss/config/conductor/connection.py", line 33, in f
return func(self, *args, **keys)
File "/home/blissadm/local/bliss.git/bliss/config/conductor/connection.py", line 263, in lock
status = wait_lock.get()
File "/home/blissadm/local/bliss.git/bliss/config/conductor/connection.py", line 81, in get
return self._queue.get()
RuntimeError: lock timeout (('wcid10i',))
The set
and get
functions of the Wago controller are decorated with @synchronized
that wraps the function with a with Lock(...):
context manager.
@sebastien.petitdemange thinks it might happen if a Ctrl+C
is issued while the lock is taken, in which case the context manager never release the lock (the refcount is not decremented).