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
>>> 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)
...
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.
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.
[quote=“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[/quote]
i confirm i have installed Tango 9.2 and libzmq 4.2.1
I tried both version, but nothing helped with the event problem in my case. I got always events with errors, but after installing the zmq version 4.2.5 it works.
Thanks for your feedback.
What kind of errors did you get? Do you mean you didn’t receive any event after a while like JCM who created this topic on the forum?
Could you give us more details?
the story becomes more and more strange. After installing the 4.2.5 version of ZMQ all worked fine for me, but I hadn’t store the output of the ZMQ and TANGO on the screen for my little test program. So I wanted to switch back to the original ZMQ version and deinstalled the 4.2.5 (compiled from sources) version. After starting my test program works now fine as before with the installed 4.2.5 version. Also the restarting of server, client, and Tango-DB didn’t change the behavior. Maybe a system restart will change this.
But What I could tell you from my memory, is that the first event came as expected and all others had the ‘err’ flag set. The error messages gave me the hint that the server would not run, but it wasn’t the case and with the help of Astor and Jive I saw that the events are fired from the server.
I’m using the Debian 9.8 (stretch), the libtango9 (9.2.5a+dfsg1-2), tango-db (9.2.5a+dfsg1-2), and python-pytango (9.2.0-2) packages.
What you are describing sounds like a typical heartbeat problem where you get an error event every 10 seconds, followed by a synchronous read_attribute call because the event client tries to subscribe again because it thinks the remote device server is not running.
Does this corresponds to what you are observing?
Be careful with the ZMQ 4.2.0 or 4.2.1 because as I said to the original poster on this forum thread, there is a bug preventing you to receive more than 1000 events when using these versions, unless you use cppTango 9.3.3
This number is sharp (1000 by default, corresponding to TANGO_EVENT_BUFFER_HWM) but the problem occurs only if the client subscribes to several publishers.
This is probably why you didn’t see it with your test program.
In this specific case (event client subscribing to at least 2 subscribers), it will receive only 1000 events (it might be 1000 events after having subscribed to the 2nd publisher).
This issue is described in cppTango#444.