Bankim Bhavsar has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/17585 )

Change subject: [consensus] KUDU-2302: don't crash if new leader can't resolve 
peer
......................................................................


Patch Set 4:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/17585/4/src/kudu/consensus/consensus-test-util.h
File src/kudu/consensus/consensus-test-util.h:

http://gerrit.cloudera.org:8080/#/c/17585/4/src/kudu/consensus/consensus-test-util.h@342
PS4, Line 342:     *proxy = std::unique_ptr<MockedPeerProxy>(proxy_);
This could be dangerous. The ownership of the raw ptr has been transferred to 
the unique_ptr but the proxy_ still points to a location which can be deleted 
by the caller of NewProxy() holding the unique_ptr.

It'd be better if proxy_ itself is a unique_ptr.


http://gerrit.cloudera.org:8080/#/c/17585/4/src/kudu/consensus/consensus_peers-test.cc
File src/kudu/consensus/consensus_peers-test.cc:

http://gerrit.cloudera.org:8080/#/c/17585/4/src/kudu/consensus/consensus_peers-test.cc@152
PS4, Line 152:     return proxy_ptr;
> warning: Use of memory after it is freed [clang-analyzer-cplusplus.NewDelet
This piece looks problematic even before this change.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I22d870ecc526fa47b97f6856c3b023bc1ec029c7
Gerrit-Change-Number: 17585
Gerrit-PatchSet: 4
Gerrit-Owner: Andrew Wong <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Bankim Bhavsar <[email protected]>
Gerrit-Reviewer: Grant Henke <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Fri, 11 Jun 2021 19:21:18 +0000
Gerrit-HasComments: Yes

Reply via email to