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

election: Avoid holding the main lock for too long #1364

Merged
merged 23 commits into from Apr 17, 2018
Merged

election: Avoid holding the main lock for too long #1364

merged 23 commits into from Apr 17, 2018

Conversation

jfsmig
Copy link
Contributor

@jfsmig jfsmig commented Feb 15, 2018

The resolution of the peers is now deferred in tasks managed by a GThreadPool, out of any critical section. The decaching upon error is also postponed to the next resolution on that election.

@jfsmig jfsmig self-assigned this Feb 15, 2018
@jfsmig jfsmig changed the title election: Avoid locking the main lock for too long election: Avoid holding the main lock for too long Feb 15, 2018
@jfsmig jfsmig changed the title election: Avoid holding the main lock for too long [wip] election: Avoid holding the main lock for too long Feb 15, 2018
@jfsmig jfsmig changed the title [wip] election: Avoid holding the main lock for too long election: Avoid holding the main lock for too long Feb 16, 2018
@codecov-io
Copy link

codecov-io commented Feb 16, 2018

Codecov Report

Merging #1364 into 4.1.x will increase coverage by 0.28%.
The diff coverage is 94.52%.

Impacted file tree graph

@@            Coverage Diff            @@
##           4.1.x    #1364      +/-   ##
=========================================
+ Coverage   76.7%   76.99%   +0.28%     
=========================================
  Files        301      301              
  Lines      56287    56938     +651     
  Branches    6805     6831      +26     
=========================================
+ Hits       43176    43837     +661     
+ Misses     12953    12948       -5     
+ Partials     158      153       -5
Impacted Files Coverage Δ
core/oiostr.h 100% <ø> (ø) ⬆️
core/ext.c 96.61% <ø> (ø) ⬆️
sqlx/sqlx_service.c 84.3% <ø> (-0.54%) ⬇️
core/str.c 88.09% <100%> (+0.17%) ⬆️
tests/unit/test_sqliterepo_election.c 96.82% <100%> (+1.56%) ⬆️
sqliterepo/replication_dispatcher.c 51.81% <50%> (-0.36%) ⬇️
sqliterepo/repository.c 74.05% <50%> (-1.86%) ⬇️
sqliterepo/synchro.c 65.19% <66.66%> (-0.21%) ⬇️
sqliterepo/election.c 88.73% <94.22%> (+1.53%) ⬆️
oio/account/client.py 78.88% <0%> (-5.56%) ⬇️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 780f9dc...db2cf7c. Read the comment docs.

@jfsmig jfsmig changed the title election: Avoid holding the main lock for too long [wip] election: Avoid holding the main lock for too long Feb 22, 2018
@jfsmig jfsmig changed the title [wip] election: Avoid holding the main lock for too long election: Avoid holding the main lock for too long Apr 12, 2018
@jfsmig jfsmig requested review from murlock, fvennetier and kamel-rahim and removed request for fvennetier April 12, 2018 18:43
GError *err = election_get_peers(M, &n, decache, &peers);

member_lock(m);
if (err || !peers || !*peers) {
Copy link
Member

Choose a reason for hiding this comment

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

We should probably do something with err, at least free it 😉

@fvennetier fvennetier merged commit 9d29fe0 into open-io:4.1.x Apr 17, 2018
@jfsmig jfsmig deleted the 4.1.x-election-short-lock branch April 25, 2018 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants