Adar Dembo has submitted this change and it was merged.

Change subject: net_util: update address-in-use collision check for lsof 4.89
......................................................................


net_util: update address-in-use collision check for lsof 4.89

Version 4.89 has changed how lsof handles output when -F is provided. Now,
the file descriptor is always selected, which means if we don't filter it
out, we'll end up with the following output:

  adar@adar-ThinkPad-T540p:~/Source/kudu/build/debug$ lsof -n -i 'TCP:43540' 
-sTCP:LISTEN ; for pid in $(lsof -F p -n -i 'TCP:43540' -sTCP:LISTEN | cut -f 2 
-dp) ; do while [ $pid -gt 1 ] ; do ps h -fp $pid ; stat=($(</proc/$pid/stat)) 
; pid=${stat[3]} ; done ; done
  COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
  java    15955 adar   97u  IPv6 4668514      0t0  TCP 127.0.0.1:43540 (LISTEN)
  adar     15955 15643  1 Apr28 ?        Sl    74:47 /usr/bin/java 
-Dosgi.requiredJavaVersion=1.7 -XX:MaxPermSize=256m -
  adar     15643  2944  0 Apr28 ?        Sl     0:00 /opt/eclipse/eclipse
  adar      2944  1650  0 Apr26 ?        Ss     0:00 /sbin/upstart --user
  root      1650  1484  0 Apr26 ?        Sl     0:00 lightdm --session-child 12 
19
  root      1484     1  0 Apr26 ?        SLsl   0:00 /usr/sbin/lightdm
  bash: [: f97: integer expression expected

Adding a 'grep p' to the pipeline filters out the file descriptor, and is a
no-op with an older lsof (where the file descriptor is not selected).

Change-Id: Id687fc40c7de09465da1b6b2ba16f2befa93f2e1
Reviewed-on: http://gerrit.cloudera.org:8080/2921
Reviewed-by: Adar Dembo <[email protected]>
Tested-by: Adar Dembo <[email protected]>
---
M src/kudu/util/net/net_util.cc
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Adar Dembo: Looks good to me, approved; Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id687fc40c7de09465da1b6b2ba16f2befa93f2e1
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to