Adar Dembo has posted comments on this change. Change subject: consensus_peers: capture weak refs in functors submitted to thread pools ......................................................................
Patch Set 2: (2 comments) http://gerrit.cloudera.org:8080/#/c/7543/2//COMMIT_MSG Commit Message: PS2, Line 15: less useful than I had hoped > does it have any use at all then? or is it just documentation value? ie is The lifespan does shrink if there are no outstanding RPCs; this text just reflects my earlier hope of doing "weak ref on every capture" rather than "weak ref on every capture if possible, strong ref otherwise". http://gerrit.cloudera.org:8080/#/c/7543/2/src/kudu/consensus/consensus_peers.cc File src/kudu/consensus/consensus_peers.cc: PS2, Line 150: shared_ptr<Peer> p = w_this.lock(); : if (!p) { : // The functor outlived its peer. : return; : } : p->SendNextRequest(even_if_queue_empty); > I seem to recall that in newer versions of C++ you can do: Yes, that's pretty nice. Will use that instead. -- To view, visit http://gerrit.cloudera.org:8080/7543 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dbb777e7e141f1f5bf48026779f1d4b26185195 Gerrit-PatchSet: 2 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-HasComments: Yes