Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Barrier cleanup #1092

Merged
merged 5 commits into from Jun 15, 2017

Conversation

Projects
None yet
4 participants
@garlick
Copy link
Member

garlick commented Jun 14, 2017

This PR modifies flux_barrier() to return a flux_future_t.

It also eliminates the libflux-barrier.so shared library and folds the one function in it into libflux. If the barrier module is not loaded, this function will return NULL with errno == ENOSYS.

Finally, it cleans up the function to eliminate exit-on-enomem behavior.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Jun 14, 2017

Coverage Status

Changes Unknown when pulling 666f56e on garlick:barrier_cleanup into ** on flux-framework:master**.

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jun 14, 2017

Codecov Report

Merging #1092 into master will decrease coverage by 0.09%.
The diff coverage is 82.75%.

@@            Coverage Diff            @@
##           master    #1092     +/-   ##
=========================================
- Coverage   78.03%   77.94%   -0.1%     
=========================================
  Files         151      151             
  Lines       26105    26115     +10     
=========================================
- Hits        20371    20355     -16     
- Misses       5734     5760     +26
Impacted Files Coverage Δ
src/bindings/lua/flux-lua.c 81.67% <100%> (+0.05%) ⬆️
src/common/libflux/barrier.c 84.84% <80%> (ø)
src/common/libflux/keepalive.c 86.66% <0%> (-6.67%) ⬇️
src/common/libflux/ev_flux.c 97.56% <0%> (-2.44%) ⬇️
src/cmd/builtin/proxy.c 72.87% <0%> (-1.59%) ⬇️
src/broker/module.c 82.25% <0%> (-1.41%) ⬇️
src/broker/content-cache.c 72.98% <0%> (-1.31%) ⬇️
src/broker/modservice.c 79.2% <0%> (-1%) ⬇️
src/common/libflux/dispatch.c 85.54% <0%> (-0.79%) ⬇️
src/connectors/local/local.c 86.82% <0%> (-0.78%) ⬇️
... and 7 more

garlick added some commits Jun 13, 2017

libflux/barrier: eliminate standalone library
Instead of building libbarrier.so as a standalone library,
fold it into libflux.so.
libflux/barrier: fix inconsistent handle state key
Problem: flux_barrier(), when called with a NULL name,
creates a unique barrier name based on a counter which
it stores in the flux_t handle under a key.  However,
the keys used to store and retrieve this state are
inconsistent so it starts from scratch each time, resulting
in non-unique barrier names.

Make the aux key names consistent.
libflux/barrier: avoid exit on ENOMEM
Problem: flux_barrier() implementation calls xzmalloc() and
xasprintf() internally.  These function call exit(1) on
malloc failure and thus are inappropriate in a libflux function.

Use malloc() and related functions directly and return ENOMEM
to the caller if an out of memory error occurs.
libflux/barrier: return a flux_future_t
Problem: flux_barrier () hardwires synchronous operation.

Have flux_barrier() return a future instead of integer success
code.  It can be completed with flux_future_get(f, NULL).

Convert users.
test/barrier: relocate tbarrier test
Relocate "tbarrier" from src/test to t/barrier, like all
the other sharness-drive C test programs.

@garlick garlick force-pushed the garlick:barrier_cleanup branch from 666f56e to 3c384e6 Jun 14, 2017

@coveralls

This comment has been minimized.

Copy link

coveralls commented Jun 14, 2017

Coverage Status

Changes Unknown when pulling 3c384e6 on garlick:barrier_cleanup into ** on flux-framework:master**.

@grondo

This comment has been minimized.

Copy link
Contributor

grondo commented Jun 15, 2017

This looks like pretty good cleanup. I was going to say this misses the doc changes, but there's no doc for flux_barrier yet. So merge?

@garlick

This comment has been minimized.

Copy link
Member Author

garlick commented Jun 15, 2017

Sure, thanks.

@grondo grondo merged commit c5f839d into flux-framework:master Jun 15, 2017

4 checks passed

codecov/patch 82.75% of diff hit (target 78.03%)
Details
codecov/project Absolute coverage decreased by -0.09% but relative coverage increased by +4.72% compared to 7a9c8d7
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 78.204%
Details

@grondo grondo referenced this pull request Aug 23, 2017

Closed

0.8.0 Release #1160

@garlick garlick deleted the garlick:barrier_cleanup branch Sep 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.