Adar Dembo has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/10879 )

Change subject: consensus: release lock before doing DNS lookups in leader 
elections
......................................................................

consensus: release lock before doing DNS lookups in leader elections

Noticed this while poring over a ~60k thread pstack dump from an overloaded
cluster. Ignoring for a minute that the consensus lock isn't actually needed
to serialize this work, taking a spinlock during a potentially blocking
operation is a no-no. As is doing substantive work in a class constructor;
that's a violation of POLA [1] in our codebase.

1. https://en.wikipedia.org/wiki/Principle_of_least_astonishment

Change-Id: I8403ed74d3199ef90779b86bb7d9727a3c4af876
Reviewed-on: http://gerrit.cloudera.org:8080/10879
Reviewed-by: Todd Lipcon <[email protected]>
Tested-by: Adar Dembo <[email protected]>
---
M src/kudu/consensus/leader_election.cc
M src/kudu/consensus/leader_election.h
M src/kudu/consensus/raft_consensus.cc
3 files changed, 59 insertions(+), 46 deletions(-)

Approvals:
  Todd Lipcon: Looks good to me, approved
  Adar Dembo: Verified

--
To view, visit http://gerrit.cloudera.org:8080/10879
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8403ed74d3199ef90779b86bb7d9727a3c4af876
Gerrit-Change-Number: 10879
Gerrit-PatchSet: 3
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Mike Percy <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to