WIP: add partial libuv support - #6902
Open
garlick wants to merge 6 commits into
Open
Conversation
Problem: flux-core only supports libev (vendored or external). Add a --with-libuv configure option which causes HAVE_LIBUV to be defined in config.h and defines LIBUV to be tested in Makefile.am's. Rename --with-external-libev to --with-libev to match. If neither --with-libev nor --with-libuv are specified, use vendored libev.
Problem: if ev_loop() fails in flux_reactor_create(), the destructor is called with a reference count that causes it to do nothing. Just call free instead of calling the destructor.
Problem: flux_watcher_destroy() could clobber errno. Save/restore errno within the function.
Problem: supporting both libuv and libev in watcher_wrap.c with preprocessor ifdefs will be a mess. Rename watcher_wrap.c to watcher_ev.c in anticipating of adding a separate watcher_uv.c version.
Problem: the flux reactor lacks an interface for embedding in other reactors. libev doesn't offer access to a file descriptor that becomes ready when events are pending. However, libuv provides uv_backend_fd(). Therefore, let's begin a port of libuv to Flux. This commit creates an alternate libflux reactor implementation based on libuv that is selected when flux-core is configured --with-libuv. Reactor watchers are dealt with in a separate commit.
Problem: the libuv port lacks Flux watcher implementations. Add implementations for the built-in Flux watchers, except periodic watchers. flux_watcher_set_priority() is not implemented.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6902 +/- ##
=======================================
Coverage 83.83% 83.83%
=======================================
Files 539 539
Lines 90269 90268 -1
=======================================
+ Hits 75674 75678 +4
+ Misses 14595 14590 -5
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: as discussed in #3969, it is hard to embed the flux reactor in another event loop because it doesn't expose an interface for notification when events are pending (such as a file descriptor). It cannot, because libev does not. libuv does, hence the interest in replacing libev with libuv.
This PR adds a new configure option:
When configured that way, libev is replaced with libuv. However, this is still a WIP due to:
flux_watcher_set_priority()isn't implemented (we support it for check watchers only)Given the experimental label, perhaps we could merge this if we could do the following:
Then when the reactor embedding issue priority goes up again at some point, perhaps someone can pick this up and resolve any remaining issues.
See also