events are blocked or slowed down after a while

Hi,

I use events in a device written in c ++. But I have blockages after a few minutes … My understanding of events is surely not enough …
So I did this very simple test (similar) in python with 2 events on 2 instances of TangoTest. One or both of them also lock up after a few minutes …

Many useful information :)

2 device proxy:
'sys/tg_test/1'
'sys/tg_test/jcm
2 callback (class) called with push_event()

2 events suscribed on change value attribute:
double_scalar_w
short_scalar_w

true loop 100ms

Polling 10ms and change event 0.1
Writing new value every 500ms



reader side:


import PyTango,time

mybool=1

devtangotestdoublew='sys/tg_test/1'
dptangotestdoublew=PyTango.DeviceProxy(devtangotestdoublew)

devtangotestshort='sys/tg_test/jcm'
dptangotestshort=PyTango.DeviceProxy(devtangotestshort)

class CBTANGOTESTDOUBLEW():
def push_event(self,event):
print (" tangotest1: ",event.attr_value.value)
time.sleep(0.1)

class CBTANGOTESTSHORT():
def push_event(self,event):
print ("tangotestjcm: ",event.attr_value.value)
time.sleep(0.1)

cbtangotestdoublew=CBTANGOTESTDOUBLEW()
evttangotestodublew=dptangotestdoublew.subscribe_event('double_scalar_w',PyTango
.EventType.CHANGE_EVENT,cbtangotestdoublew)

cbtangotestshort=CBTANGOTESTSHORT()
evttangotestshort=dptangotestshort.subscribe_event('short_scalar_w',PyTango.Even
tType.CHANGE_EVENT,cbtangotestshort)

while mybool==1:
time.sleep(0.1)



writer side:


>>> dev='sys/tg_test/1'
>>> dp=PyTango.DeviceProxy(dev)
>>> devjcm='sys/tg_test/jcm'
>>> dpjcm=PyTango.DeviceProxy(devjcm)
>>>
>>> for i in range (0,1000000):
… for j in range (1,10):
… dp.double_scalar_w=j
… dpjcm.short_scalar_w=j
… time.sleep(0.5)




I would like some help please. Thank you


Hi,

What version of ZMQ are you using?

Here is an extract of cppTango 9.3.3 release notes:

A bug in ZMQ 4.2.0 and ZMQ 4.2.1 was preventing clients to receive more than 1000 events. We found a work-around so if you use this new Tango C++ library version, you should not be impacted by this ZMQ bug unless you are tuning the event system high water mark with the CtrlSystem/EventBufferHwm free property. And even in this case, if you restart all your clients after changing the value of this free property, you should be fine until the next time you change the value of this advanced free property, which should not be the case for 99.9999999% of our users (estimation which is not 100% accurate).

If you are using ZMQ 4.2.0 or ZMQ 4.2.1, we encourage you to use a different ZMQ version or to upgrade to Tango 9.3.
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
You could also be affected by the following issue if you are using Tango Access Control:

https://github.com/tango-controls/cppTango/issues/507
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hi,

Reynald
Hi,

What version of ZMQ are you using?

Here is an extract of cppTango 9.3.3 release notes:

A bug in ZMQ 4.2.0 and ZMQ 4.2.1 was preventing clients to receive more than 1000 events. We found a work-around so if you use this new Tango C++ library version, you should not be impacted by this ZMQ bug unless you are tuning the event system high water mark with the CtrlSystem/EventBufferHwm free property. And even in this case, if you restart all your clients after changing the value of this free property, you should be fine until the next time you change the value of this advanced free property, which should not be the case for 99.9999999% of our users (estimation which is not 100% accurate).

If you are using ZMQ 4.2.0 or ZMQ 4.2.1, we encourage you to use a different ZMQ version or to upgrade to Tango 9.3.

I use Tango 9.2
but no module ZMQ for python:
>>> import zmq
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named zmq


Thanks.
What is your operating system?
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Reynald
What is your operating system?

Debian 9.6

So if you installed libtango9 (Tango C++ library) from the official Debian repository, you got the Debian package libzmq5 installed with it, which is actually libzmq 4.2.1. So you are affected by the ZMQ bug.

One solution to overcome this bug is to install cppTango 9.3.3 from the source code or using the Bintray cppTango dev Debian package (install instructions when clicking on the "Set me up!" blue button).
You might need to uninstall libtango9 package to be able to install this development package.

You could also try to find a way to install libzmq >= 4.2.2 or libzmq < 4.2.0.

Hoping this helps.
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
If you are familiar with Conda environments, you could also try to install the latest pytango conda package which will install the latest tango conda package (Tango C++ library) too.
I think the bug is only on the event subscriber side. So if your event subscribers are only in Python, this could be an alternative solution. but you will have to run your python Tango clients from a Conda environment.

PS: I hope I didn't say too many stupid things here. I don't know much Conda.
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hi,

Reynald
So if you installed libtango9 (Tango C++ library) from the official Debian repository, you got the Debian package libzmq5 installed with it, which is actually libzmq 4.2.1. So you are affected by the ZMQ bug.

One solution to overcome this bug is to install cppTango 9.3.3 from the source code or using the Bintray cppTango dev Debian package (install instructions when clicking on the "Set me up!" blue button).
You might need to uninstall libtango9 package to be able to install this development package.

You could also try to find a way to install libzmq >= 4.2.2 or libzmq < 4.2.0.

Hoping this helps.
Reynald

i confirm i have installed Tango 9.2 and libzmq 4.2.1

> dpkg -l |grep libzmq
ii libzmq3-dev:amd64 4.2.1-4+deb9u1 amd64 lightweight messaging kernel (development files)
ii libzmq5:amd64 4.2.1-4+deb9u1 amd64 lightweight messaging kernel (shared library)

I will see how to reinstall Tango or libzmq.

Thank you



Reynald
One solution to overcome this bug is to install cppTango 9.3.3 from the source code or using the Bintray cppTango dev Debian package (install instructions when clicking on the "Set me up!" blue button).

I tried this, but it does not work. Neither adding the repository

deb https://dl.bintray.com/tango-controls/debian stretch Release


this will be ignored by the apt update (even if I set this repo to trusted=yes)

nor find the 9.3.3 debian package.

Is there any hint?

Jens


 
Register or login to create to post a reply.