Hello Kudu Jenkins,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/20514

to look at the new patch set (#2).

Change subject: KUDU-3507 Fix mini ranger port detection
......................................................................

KUDU-3507 Fix mini ranger port detection

There are 2 problems with MiniRangerKMS port detection:
+ lsof might handle 0.0.0.0 as ipv6 and won't show ports opened on it
  with "4TCP" filter. We find the other port the process opens.
+ There are 2 ports opened by the process. Even if we know for sure that
  the other port will be open after the api port, and will be later in
  the lsof list (which is probably not always true), we might still manage to
  get the wrong port with the following steps:
    + We run scan for 0.0.0.0
    + Process opens both ports
    + We run scan for 127.0.0.1 -> get wrong port.

Solution:
+ I think just changing the "4TCP" and "4UDP" filter to "TCP" and "UDP"
  in the test utils is fine. Alternatively we could just scan ipv6 if
  0.0.0.0 is provided, but it seems superfluous.
+ We know the port, because we just wrote it in the config. So we should
  just wait for that port to be opened by the process. If for some
  reason an other port is opened, we can fall back to the original
  method after the timeout.

WaitForBindAtPort is also not implemented correctly. It return with
error when lsof fails. But lsof fails if there is no data:
https://github.com/lsof-org/lsof/issues/128

Change-Id: I89c3409e9efd53a821a6d4244a35564e134323bb
---
M src/kudu/ranger-kms/mini_ranger_kms.cc
M src/kudu/util/test_util.cc
M src/kudu/util/test_util.h
3 files changed, 52 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/14/20514/2
--
To view, visit http://gerrit.cloudera.org:8080/20514
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I89c3409e9efd53a821a6d4244a35564e134323bb
Gerrit-Change-Number: 20514
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zmarto...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

Reply via email to