Andrew Wong has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/17892 )
Change subject: [rpc] allow reuse of outbound request buffers when retrying ...................................................................... [rpc] allow reuse of outbound request buffers when retrying This patch fixes a heap-use-after-free bug in the address-re-resolving proxy caused by the fact that requests may be stack allocated, are serialized once when making the OutboundCall, and then thrown away once calling the (typically) user-provided callback. This patch splits out the state that may be used by retries (i.e. the serialized request, header, and sidecars) into its own class, and passes this around when retrying. There are some methods that don't appear to be used in this codebase, but I opted to keep existing behavior because they seem to be used in other codebases that share library code. Specifically, I don't see usage of RpcController::AddOutboundSidecar(), but this does seem to be used in Impala[1]. 1. https://github.com/apache/impala/blob/b28da054f3595bb92873433211438306fc22fbc7/be/src/rpc/sidecar-util.h#L48 Change-Id: I118f3559c4647bdd996617443bd371a041711295 Reviewed-on: http://gerrit.cloudera.org:8080/17892 Tested-by: Andrew Wong <[email protected]> Reviewed-by: Alexey Serbin <[email protected]> --- M src/kudu/rpc/mt-rpc-test.cc M src/kudu/rpc/outbound_call.cc M src/kudu/rpc/outbound_call.h M src/kudu/rpc/proxy-test.cc M src/kudu/rpc/proxy.cc M src/kudu/rpc/proxy.h M src/kudu/rpc/rpc-test-base.h M src/kudu/rpc/rpc_controller.cc M src/kudu/rpc/rpc_controller.h 9 files changed, 272 insertions(+), 82 deletions(-) Approvals: Andrew Wong: Verified Alexey Serbin: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/17892 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I118f3559c4647bdd996617443bd371a041711295 Gerrit-Change-Number: 17892 Gerrit-PatchSet: 4 Gerrit-Owner: Andrew Wong <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Bankim Bhavsar <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241)
