Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Backport fix for #496 and #361 - event clients lost after dev restart #702

Conversation

mliszcz
Copy link
Collaborator

@mliszcz mliszcz commented Apr 6, 2020

Summary of changes comparing to original commits:

mliszcz added 5 commits April 6, 2020 09:20
Tests that event subscription is restored immediately after the device restart.
Backport of 1a07976. A new struct and a set of overloads are added to
keep backward compatibility with 9.3 release.
Add test that verifies if attribute configuration event is sent to all
subscribers after device restart (regardless if properties have changed).
Attribute properties may have changed during the restart. Push the event
to all registered subscribers to ensure that they get updated values.
@mliszcz mliszcz marked this pull request as ready for review April 6, 2020 10:40
@mliszcz mliszcz requested review from bourtemb and t-b as code owners April 6, 2020 10:40
Replace range-based for with classical loop over iterator for C++03
compatibility.
@mliszcz mliszcz force-pushed the backport-fix-496-blind-event-clients-after-dev-restart branch from 8f521d5 to 6a0ee49 Compare April 9, 2020 10:00
@t-b
Copy link
Collaborator

t-b commented Apr 30, 2020

Overall looks good.

The only thing is get_event_param/set_event_param. According to 1 "You can not ... add an overload (BC, but not SC: makes &func ambiguous), adding overloads to already overloaded functions is ok (any use of &func already needed a cast).". But the compliancy tool says good its good
compat-report.zip.

I would tend to believe the tool's output.

@mliszcz
Copy link
Collaborator Author

mliszcz commented Apr 30, 2020

@t-b thanks for pointing that out! I focused on binary compatibility but have not thought about source compatibility.

The tool is correct, the change is ABI compatible, because function signature is mangled into symbol's name in C++ ABI. So these two overloads are separate symbols pointing to different places in the code block of the library.

But, as documented in the link you referenced, any device server that does something like this, will stop compiling:

auto setter = &Device::set_event_param;

While these methods are intended to be internal for the library (not documented in doxygen), nothing prevents users from calling them from their device server code.

Do you think we need to address this somehow?

@bourtemb
Copy link
Member

But, as documented in the link you referenced, any device server that does something like this, will stop compiling:

auto setter = &Device::set_event_param;

While these methods are intended to be internal for the library (not documented in doxygen), nothing prevents users from calling them from their device server code.

Do you think we need to address this somehow?

get_event_param & set_event_param methods are not documented in Doxygen (because under /// @privatesection line).

so users are not supposed to use it.
So I think it is a source code incompatibility we can tolerate.

@t-b
Copy link
Collaborator

t-b commented Apr 30, 2020

If users are not supposed to use it we can break it ;)

@t-b t-b merged commit 85057ac into tango-controls:9.3-backports May 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants