avoid deadlock in proxy
in secop.proxy the callers modules method announceUpdate is called from an other thread while the accessLock is locked, creating a deadlock. solve this by creating an other lock 'updateLock' for the update. + add status parameter even to non-Readable proxy modules, in order to indicate a failed connection + fix an error in secop_psi/softcal.py Change-Id: Iae7c6d5a74001150a47aa9dc99209c15d972cd5e Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/28130 Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de> Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de> Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
@ -33,6 +33,7 @@ from secop.io import HasIO
|
||||
|
||||
class ProxyModule(HasIO, Module):
|
||||
module = Property('remote module name', datatype=StringType(), default='')
|
||||
status = Parameter('connection status', Readable.status.datatype) # add status even when not a Readable
|
||||
|
||||
_consistency_check_done = False
|
||||
_secnode = None
|
||||
@ -182,11 +183,12 @@ def proxy_class(remote_class, name=None):
|
||||
|
||||
for aname, aobj in rcls.accessibles.items():
|
||||
if isinstance(aobj, Parameter):
|
||||
pobj = aobj.merge(dict(handler=None, needscfg=False))
|
||||
pobj = aobj.copy()
|
||||
pobj.merge(dict(handler=None, needscfg=False))
|
||||
attrs[aname] = pobj
|
||||
|
||||
def rfunc(self, pname=aname):
|
||||
value, _, readerror = self._secnode.getParameter(self.name, pname)
|
||||
value, _, readerror = self._secnode.getParameter(self.name, pname, True)
|
||||
if readerror:
|
||||
raise readerror
|
||||
return value
|
||||
|
Reference in New Issue
Block a user