Hello Attila Bukor, Kudu Jenkins, Abhishek Chennaka, Wenzhe Zhou,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/18223
to look at the new patch set (#3).
Change subject: KUDU-3352 fix handling sockaddr_in in Sockaddr
......................................................................
KUDU-3352 fix handling sockaddr_in in Sockaddr
Since the Sockaddr class has been updated to handle various address
families, an issue with uninitialized memory in the storage_.in.sin_zero
started affecting the behavior of the Sockaddr::HashCode() method.
As the result, ReactorThread::FindOrStartConnection() could create a new
connection to the specified remote even if a connection with the
required credentials policy had already been established.
This patch addresses the issue by not counting the padding 'sin_zero'
field of the sockaddr_in structure in the length of Sockaddr::storage_
which is passed to Sockaddr::HashCode().
I also added a new test scenario to reproduce the issue, verifying that
the scenario fails if not applying the corresponding part of this patch
to src/kudu/util/net/sockaddr.cc:
[ RUN ] SockaddrHashTest.ZeroPadding
src/kudu/util/net/socket-test.cc:69: Failure
Expected equality of these values:
s_in.HashCode()
Which is: 2868988679
s_un.HashCode()
Which is: 1786951233
[ FAILED ] SockaddrHashTest.ZeroPadding (0 ms)
Credit goes to Wenzhe Zhou for detecting and troubleshooting the issue.
This is a follow-up to 79079b6b64295b06c5a0f05ed200a55d89bccc47.
Change-Id: I96fee11a4191a4f4240c460db22742880eebe7b5
---
M src/kudu/util/net/sockaddr.cc
M src/kudu/util/net/sockaddr.h
M src/kudu/util/net/socket-test.cc
3 files changed, 68 insertions(+), 4 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/23/18223/3
--
To view, visit http://gerrit.cloudera.org:8080/18223
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I96fee11a4191a4f4240c460db22742880eebe7b5
Gerrit-Change-Number: 18223
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Abhishek Chennaka <[email protected]>
Gerrit-Reviewer: Attila Bukor <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Wenzhe Zhou <[email protected]>