You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by sa...@apache.org on 2018/07/20 02:15:49 UTC

impala git commit: KUDU-2492: Make the use of SO_REUSEPORT conditional on it being defined

Repository: impala
Updated Branches:
  refs/heads/master 2a40e8f2a -> 649397e37


KUDU-2492: Make the use of SO_REUSEPORT conditional on it being defined

A recent commit to Kudu, "rpc: add experimental rpc_reuseport flag",
added the use of the rpc flag SO_REUSEREPORT. This flag is not
available with older versions of Linux, resulting in a compiler error.

This patch avoids the compiler error with a macro that checks if
SO_REUSEPORT is defined, and if it's not attempting to set it will
return an error.

--------------------------

IMPALA-7302: This is cherry-picked to fix builds breaking on CentOS 6.4.
Since some of our Jenkins machines are CentOS 6.4, and upgrading them
to our new minimum supported OS of CentOS 6.8 is non-trivial, we cherry-
pick this patch to temporarily unblock these builds until the Jenkins
AMIs are upgraded.

Change-Id: I042125cdaedafa5ebbc09e5a3c12112dfeec59a1
Reviewed-on: http://gerrit.cloudera.org:8080/10994
Reviewed-by: Thomas Marshall <th...@cmu.edu>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/649397e3
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/649397e3
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/649397e3

Branch: refs/heads/master
Commit: 649397e37dd9b33b4df7b743b8d2e1c67b2c3ad7
Parents: 2a40e8f
Author: Thomas Tauber-Marshall <tm...@cloudera.com>
Authored: Thu Jul 5 11:45:00 2018 -0700
Committer: Impala Public Jenkins <im...@cloudera.com>
Committed: Fri Jul 20 01:59:23 2018 +0000

----------------------------------------------------------------------
 be/src/kudu/util/net/socket.cc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/649397e3/be/src/kudu/util/net/socket.cc
----------------------------------------------------------------------
diff --git a/be/src/kudu/util/net/socket.cc b/be/src/kudu/util/net/socket.cc
index cc14702..bc3b525 100644
--- a/be/src/kudu/util/net/socket.cc
+++ b/be/src/kudu/util/net/socket.cc
@@ -245,10 +245,14 @@ Status Socket::SetReuseAddr(bool flag) {
 }
 
 Status Socket::SetReusePort(bool flag) {
-  int int_flag = flag ? 1 : 0;
-  RETURN_NOT_OK_PREPEND(SetSockOpt(SOL_SOCKET, SO_REUSEPORT, int_flag),
-                        "failed to set SO_REUSEPORT");
-  return Status::OK();
+  #ifdef SO_REUSEPORT
+    int int_flag = flag ? 1 : 0;
+    RETURN_NOT_OK_PREPEND(SetSockOpt(SOL_SOCKET, SO_REUSEPORT, int_flag),
+                          "failed to set SO_REUSEPORT");
+    return Status::OK();
+  #else
+    return Status::NotSupported("failed to set SO_REUSEPORT: protocol not available");
+  #endif
 }
 
 Status Socket::BindAndListen(const Sockaddr &sockaddr,