Communication between Asyncio DS and client DeviceProxy times out, when DS is observed by Jive ATK panel
Dear all, I have a simple pyTango DS in asyncio mode that only provides two scalar double attributes.
class LVProxyAsync(Device):
green_mode = GreenMode.Asyncio
async def init_device(self):
super().init_device()
self._sinus_signal=float('nan')
self._saw_signal = float('nan')
self.set_change_event('sinus_signal', True, False)
self.set_change_event('saw_signal', True, False)
self.set_state(DevState.RUNNING)
@attribute(dtype=float)
async def sinus_signal(self):
return self._sinus_signal
@sinus_signal.write
async def set_sinus_signal(self, nValue):
self.debug_stream(f"Write Sinus: {nValue}")
self._sinus_signal = nValue
self.push_change_event("sinus_signal", nValue, time.time() , q.ATTR_VALID)
@attribute(dtype=float)
async def saw_signal(self):
return self._saw_signal
@saw_signal.write
async def set_saw_signal(self, nValue):
self._saw_signal=nValue
self.push_change_event("saw_signal", nValue, time.time() , q.ATTR_VALID)
I write the attributes in a test client
from tango.asyncio import DeviceProxy as aDS
import numpy, asyncio, tango
i = 0
lvproxy_async = await aDS("lvproxyasync/lvproxyasync/1")
while True:
await lvproxy_async.write_attribute("sinus_signal", numpy.sin(i))
await lvproxy_async.write_attribute("saw_signal", numpy.sin(i))
await asyncio.sleep(0.1)
i += 1
When the Jive ATK panel is open for the DS the communication crashes after some writes with the error:
CommunicationFailed Traceback (most recent call last)
Cell In[6], line 8
5 lvproxy_async = await aDS("lvproxyasync/lvproxyasync/1")
6 while True:
7 # try:
----> 8 await lvproxy_async.write_attribute("sinus_signal", numpy.sin(i))
9 await lvproxy_async.write_attribute("saw_signal", numpy.sin(i))
10 await asyncio.sleep(0.1)
File ~/miniforge3/envs/tango/lib/python3.9/concurrent/futures/thread.py:58, in _WorkItem.run(self)
55 return
57 try:
---> 58 result = self.fn(*self.args, **self.kwargs)
59 except BaseException as exc:
60 self.future.set_exception(exc)
File ~/miniforge3/envs/tango/lib/python3.9/site-packages/tango/device_proxy.py:1688, in __DeviceProxy__write_attribute(self, *args, **kwargs)
1687 def __DeviceProxy__write_attribute(self, *args, **kwargs):
-> 1688 return self._write_attribute(*args, **kwargs)
CommunicationFailed: DevFailed[
DevError[
desc = TRANSIENT CORBA system exception: TRANSIENT_CallTimedout
origin = DeviceProxy:write_attribute()
reason = API_CorbaException
severity = ERR]
DevError[
desc = Timeout (3000 mS) exceeded on device lvproxyasync/lvproxyasync/1
origin = DeviceProxy:write_attribute()
reason = API_DeviceTimedOut
severity = ERR]
]
Various scenarios were tested: Tango DB running on Ubuntu 22.04 VM hosted on a Windows 10 PC
- DS and test code on Windows 10 host
- DS on VM, test code on Windows 10
- both on VM
Allways with same result.
It seems to be a general problem affects every asyncio DS.