Skip to content

Failsafe when Servus implementation can't created and fallback to dummy#80

Merged
hernando merged 2 commits intomasterfrom
failsafe
Oct 11, 2017
Merged

Failsafe when Servus implementation can't created and fallback to dummy#80
hernando merged 2 commits intomasterfrom
failsafe

Conversation

@hernando
Copy link
Copy Markdown

This is needed for the nix build, which is complied with avahi support, but when run somewhere where the avahi daemon is not running it crashes whatever application uses Servus.

@hernando
Copy link
Copy Markdown
Author

ping

Copy link
Copy Markdown

@rdumusc rdumusc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for the failsafe, I remember building an app on my laptop for 30 min and have it crash on startup because Servus had no implementation and this was not handled in ZeroEQ, or something similar.
If it were for me, I would not allow Servus to configure without a backend at all. But to do that we need to remove the Serializable, URI and friends from it first...

CMakeLists.txt Outdated
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libavahi-client3, avahi-daemon")
set(SERVUS_DEBIAN_PACKAGE_DEPENDS)
if (avahi-client_FOUND)
list(APPEND SERVUS_DEBIAN_PACKAGE_DEPENDS "libavahi-client3, avahi-daemon")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax is now: NAME_PACKAGE_DEB_DEPENDS, and it can be a CMake list:
https://github.com/Eyescale/CMake/blob/master/CommonCPack.cmake#L17
so this line should be:
list(APPEND SERVUS_PACKAGE_DEB_DEPENDS libavahi-client3 avahi-daemon)

doc/Changelog.md Outdated
# git master

* [80](https://github.com/HBPVis/Servus/pull/80):
Failsafe when Servus implementation can't created and fallback to dummy.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't be created

@hernando
Copy link
Copy Markdown
Author

Failsafe in ZeroEQ is another story because the dummy Servus implementation throws if you try to announce a service. This commit is intented to not make it not throw when you create a Servus object intended for browsing only.

@rdumusc
Copy link
Copy Markdown

rdumusc commented Oct 11, 2017

hmm yes, I think we'll have to revisit this API at some point. The constructor was not documented as throwing so this is a bugfix, but now that it does not throw the user can't know if he created a valid object because isAvailable() returns a compile-time constant...

@hernando hernando merged commit 2e9a23a into master Oct 11, 2017
@hernando hernando deleted the failsafe branch October 11, 2017 14:25
set(SERVUS_PACKAGE_DEB_DEPENDS)
if (avahi-client_FOUND)
list(APPEND SERVUS_PACKAGE_DEB_DEPENDS libavahi-client3 avahi-daemon)
endif()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be unconditional, otherwise catch-22

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get your point. This variable is set for packaging after configuration. If avahi was not present at configuration time you don't want to add it a as package dependency.
This is not to be confused with SERVUS_DEB_DEPENDS, which lists these packages unconditionally.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I confused it with DEB_PACKAGES.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants