tango-controls/cppTango

DeviceProxy::subscribe_event(Tango::INTERFACE_CHANGE_EVENT,cb_ptr,true) throwing exception when target device server is not running

Closed this issue · 1 comments

As reported by @Matteo04052017 on tango-controls slack general channel, DeviceProxy::subscribe_event(Tango::INTERFACE_CHANGE_EVENT,cb_ptr,true) is throwing the following exception when the target device server is not yet running:

Severity = ERROR
Error reason = API_NotSupportedFeature
Desc : Device test/universal/1 does not support device interface change event
Available since Tango release 9 AND for device inheriting from IDL release 5 (Device_5Impl)
Origin : DeviceProxy::subscribe_event()

I think the event client should receive error events via its callback instead of this exception until it finally receives a correct interface change event when the device server is started, else the stateless flag is useless in this case.

Here are the messages from @Matteo04052017:

Hi channel, I am writing you (I hope this is the right channel otherwise let me know if I have to post my question somewhere else) because I have a weird behaviour concerning the interface change event and I wanted to check if it is my version of the framework or you get the same behaviour.Attached you can find a bash script that you can execute in any tango environment (it's only needed the tango host) and the result I get as well.In my case, I only get an interface change event if the device is running. Is this expected or is it a bug or is it my version of the framework?I am working with pytango 9.3.2 and tango cpp 9.3.4.Thanks allot!

example.sh.txt
myresult.txt

just a little follow up. I realized that the documentation talks about a tango restart server, so I have changed the example a bit to show the actual behavior. It is a bit better but not much.

example2.sh.txt
interface change event.txt

t-b commented

Starting point in the code

int EventConsumer::subscribe_event (DeviceProxy *device,
const std::string &attribute,
EventType event,
int event_queue_size,
const std::vector<std::string> &filters,
bool stateless)
{
.