You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2019/06/21 22:37:22 UTC

[mesos] branch master updated (c1f552c -> ebcd3fe)

This is an automated email from the ASF dual-hosted git repository.

bennoe pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from c1f552c  Added MESOS-9856 to the 1.5.4 CHANGELOG.
     new 540d9da  Updated some flag description for libprocess SSL flags.
     new c3db272  Renamed 'libprocess::network::Address::hostname()'.
     new ebcd3fe  Fixed Mesos unit tests after Address API change.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 3rdparty/libprocess/include/process/address.hpp | 10 ++++++++--
 3rdparty/libprocess/src/openssl.cpp             |  8 ++++----
 3rdparty/libprocess/src/tests/http_tests.cpp    |  6 +++---
 3rdparty/libprocess/src/tests/ssl_tests.cpp     | 19 ++++++++++++-------
 src/tests/master_tests.cpp                      | 12 +++++++-----
 5 files changed, 34 insertions(+), 21 deletions(-)


[mesos] 02/03: Renamed 'libprocess::network::Address::hostname()'.

Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bennoe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit c3db27280b29251c0b2ef29e6f9fca3efe43d5f4
Author: Benno Evers <be...@mesosphere.com>
AuthorDate: Wed Jun 19 15:44:47 2019 +0200

    Renamed 'libprocess::network::Address::hostname()'.
    
    Renamed member function `hostname()` to `lookup_hostname()`,
    since the former name hides the fact that a call to this
    function involves a synchronous network access in order
    to make a reverse DNS lookup.
    
    Review: https://reviews.apache.org/r/70885
---
 3rdparty/libprocess/include/process/address.hpp | 10 ++++++++--
 3rdparty/libprocess/src/tests/http_tests.cpp    |  6 +++---
 3rdparty/libprocess/src/tests/ssl_tests.cpp     | 19 ++++++++++++-------
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/3rdparty/libprocess/include/process/address.hpp b/3rdparty/libprocess/include/process/address.hpp
index e740e84..7494980 100644
--- a/3rdparty/libprocess/include/process/address.hpp
+++ b/3rdparty/libprocess/include/process/address.hpp
@@ -55,13 +55,19 @@ public:
     : ip(_ip), port(_port) {}
 
   /**
-   * Returns the hostname of this address's IP.
+   * Returns the hostname of this address's IP,
+   * using a reverse DNS lookup for remote addresses
+   * or the local hostname for a local address.
    *
    * @returns the hostname of this address's IP.
    */
   // TODO(jmlvanre): Consider making this return a Future in order to
   // deal with slow name resolution.
-  Try<std::string> hostname() const
+  //
+  // TODO(bevers): A given IP can have multiple associated PTR records,
+  // (e.g. a shared web server hosting multiple domains), so the return
+  // value should probably be a list of strings.
+  Try<std::string> lookup_hostname() const
   {
     const Try<std::string> hostname = ip.isAny()
       ? net::hostname()
diff --git a/3rdparty/libprocess/src/tests/http_tests.cpp b/3rdparty/libprocess/src/tests/http_tests.cpp
index 97aaf3e..4d37294 100644
--- a/3rdparty/libprocess/src/tests/http_tests.cpp
+++ b/3rdparty/libprocess/src/tests/http_tests.cpp
@@ -2218,7 +2218,7 @@ TEST_F(HttpServeTest, Pipelining)
     .WillOnce(DoAll(FutureArg<0>(&request3), Return(promise3.future())))
     .WillRepeatedly(Return(http::OK()));
 
-  http::URL url("http", address.hostname().get(), address.port, "/");
+  http::URL url("http", address.lookup_hostname().get(), address.port, "/");
 
   http::Request request;
   request.method = "GET";
@@ -2313,7 +2313,7 @@ TEST_F(HttpServeTest, Discard)
   EXPECT_CALL(handler, handle(_))
     .WillOnce(DoAll(FutureArg<0>(&request1), Return(promise1.future())));
 
-  http::URL url("http", address.hostname().get(), address.port, "/");
+  http::URL url("http", address.lookup_hostname().get(), address.port, "/");
 
   http::Request request;
   request.method = "GET";
@@ -2450,7 +2450,7 @@ TEST(HttpServerTest, Pipeline)
     .WillOnce(DoAll(FutureArg<0>(&request3), Return(promise3.future())))
     .WillRepeatedly(Return(http::OK()));
 
-  http::URL url("http", address->hostname().get(), address->port, "/");
+  http::URL url("http", address->lookup_hostname().get(), address->port, "/");
 
   http::Request request;
   request.method = "GET";
diff --git a/3rdparty/libprocess/src/tests/ssl_tests.cpp b/3rdparty/libprocess/src/tests/ssl_tests.cpp
index 6b8496a..5d36022 100644
--- a/3rdparty/libprocess/src/tests/ssl_tests.cpp
+++ b/3rdparty/libprocess/src/tests/ssl_tests.cpp
@@ -551,13 +551,15 @@ TEST_F(SSLTest, HTTPSGet)
 
   ASSERT_SOME(server);
   ASSERT_SOME(server->address());
-  ASSERT_SOME(server->address()->hostname());
+
+  Try<std::string> serverHostname = server->address()->lookup_hostname();
+  ASSERT_SOME(serverHostname);
 
   Future<Socket> socket = server->accept();
 
   // Create URL from server hostname and port.
   const http::URL url(
-      "https", server->address()->hostname().get(), server->address()->port);
+      "https", serverHostname.get(), server->address()->port);
 
   // Send GET request.
   Future<http::Response> response = http::get(url);
@@ -589,13 +591,15 @@ TEST_F(SSLTest, HTTPSPost)
 
   ASSERT_SOME(server);
   ASSERT_SOME(server->address());
-  ASSERT_SOME(server->address()->hostname());
+
+  Try<std::string> serverHostname = server->address()->lookup_hostname();
+  ASSERT_SOME(serverHostname);
 
   Future<Socket> socket = server->accept();
 
   // Create URL from server hostname and port.
   const http::URL url(
-      "https", server->address()->hostname().get(), server->address()->port);
+      "https", serverHostname.get(), server->address()->port);
 
   // Send POST request.
   Future<http::Response> response =
@@ -631,7 +635,9 @@ TEST_F(SSLTest, SilentSocket)
 
   ASSERT_SOME(server);
   ASSERT_SOME(server->address());
-  ASSERT_SOME(server->address()->hostname());
+
+  Try<std::string> serverHostname = server->address()->lookup_hostname();
+  ASSERT_SOME(serverHostname);
 
   Future<Socket> socket = server->accept();
 
@@ -657,7 +663,7 @@ TEST_F(SSLTest, SilentSocket)
   // undergoing the SSL handshake.
   const http::URL url(
       "https",
-      server->address()->hostname().get(),
+      serverHostname.get(),
       server->address()->port);
 
   Future<http::Response> response = http::get(url);
@@ -689,7 +695,6 @@ TEST_F(SSLTest, ShutdownThenSend)
 
   ASSERT_SOME(server);
   ASSERT_SOME(server->address());
-  ASSERT_SOME(server->address()->hostname());
 
   Future<Socket> socket = server->accept();
 


[mesos] 01/03: Updated some flag description for libprocess SSL flags.

Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bennoe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 540d9da5abc52f1e02d360478d2781ddf80d1599
Author: Benno Evers <be...@mesosphere.com>
AuthorDate: Wed May 29 14:02:05 2019 +0200

    Updated some flag description for libprocess SSL flags.
    
    Changed `SSL` to `TLS` in some flag descriptions where the
    flag was referring to versions of the TLS protocol.
    
    Review: https://reviews.apache.org/r/70747
---
 3rdparty/libprocess/src/openssl.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/3rdparty/libprocess/src/openssl.cpp b/3rdparty/libprocess/src/openssl.cpp
index e7dbd67..19d25a8 100644
--- a/3rdparty/libprocess/src/openssl.cpp
+++ b/3rdparty/libprocess/src/openssl.cpp
@@ -147,22 +147,22 @@ Flags::Flags()
 
   add(&Flags::enable_tls_v1_0,
       "enable_tls_v1_0",
-      "Enable SSLV1.0.",
+      "Enable TLSv1.0.",
       false);
 
   add(&Flags::enable_tls_v1_1,
       "enable_tls_v1_1",
-      "Enable SSLV1.1.",
+      "Enable TLSv1.1.",
       false);
 
   add(&Flags::enable_tls_v1_2,
       "enable_tls_v1_2",
-      "Enable SSLV1.2.",
+      "Enable TLSv1.2.",
       true);
 
   add(&Flags::enable_tls_v1_3,
       "enable_tls_v1_3",
-      "Enable SSLV1.3.",
+      "Enable TLSv1.3.",
       false);
 }
 


[mesos] 03/03: Fixed Mesos unit tests after Address API change.

Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bennoe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit ebcd3feee03f3a6666d7f4015ed15f71701b8252
Author: Benno Evers <be...@mesosphere.com>
AuthorDate: Tue Jun 4 19:42:07 2019 +0200

    Fixed Mesos unit tests after Address API change.
    
    Adjusted some Mesos unit tests after the renaming
    of `Address::hostname()` -> `Address::lookup_hostname()`.
    
    Review: https://reviews.apache.org/r/70796
---
 src/tests/master_tests.cpp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 097f1b7..791c9a0 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -169,14 +169,14 @@ TEST_F(MasterTest, TaskRunning)
 
   // Ensure the hostname and url are set correctly.
   EXPECT_EQ(
-      slave.get()->pid.address.hostname().get(),
+      slave.get()->pid.address.lookup_hostname().get(),
       offers.get()[0].hostname());
 
   mesos::URL url;
   url.set_scheme("http");
   url.mutable_address()->set_ip(stringify(slave.get()->pid.address.ip));
   url.mutable_address()->set_hostname(
-      slave.get()->pid.address.hostname().get());
+      slave.get()->pid.address.lookup_hostname().get());
 
   url.mutable_address()->set_port(slave.get()->pid.address.port);
   url.set_path("/" + slave.get()->pid.id);
@@ -1447,7 +1447,7 @@ TEST_F(HostnameTest, LookupEnabled)
   ASSERT_SOME(master);
 
   EXPECT_EQ(
-      master.get()->pid.address.hostname().get(),
+      master.get()->pid.address.lookup_hostname().get(),
       master.get()->getMasterInfo().hostname());
 }
 
@@ -3642,8 +3642,10 @@ TEST_F(MasterZooKeeperTest, MasterInfoAddress)
 
   // Protect from failures on those hosts where
   // hostname cannot be resolved.
-  if (master.get()->pid.address.hostname().isSome()) {
-    ASSERT_EQ(master.get()->pid.address.hostname().get(), address.hostname());
+  if (master.get()->pid.address.lookup_hostname().isSome()) {
+    ASSERT_EQ(
+        master.get()->pid.address.lookup_hostname().get(),
+        address.hostname());
   }
 
   driver.stop();