You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2018/10/22 21:26:19 UTC

[mesos] branch 1.5.x updated (94686d5 -> cc1ff4b)

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

tillt pushed a change to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from 94686d5  Updated version to 1.5.2 in configure.ac and CMakeLists.txt.
     new 5b2e79e  Updated docker image fetcher to enforce HTTP 1.1 where needed.
     new cc1ff4b  Added MESOS-8907 to the 1.5.3 CHANGELOG.

The 2 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:
 CHANGELOG                   | 10 +++++++++-
 src/uri/fetchers/docker.cpp | 25 ++++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 2 deletions(-)


[mesos] 02/02: Added MESOS-8907 to the 1.5.3 CHANGELOG.

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

tillt pushed a commit to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit cc1ff4b7e79cadf3381cd0a71b04a50c655b2c85
Author: Till Toenshoff <to...@me.com>
AuthorDate: Mon Oct 22 22:03:56 2018 +0200

    Added MESOS-8907 to the 1.5.3 CHANGELOG.
---
 CHANGELOG | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 54469d7..ec8ccad 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,8 +1,16 @@
-Release Notes - Mesos - Version 1.5.2
+Release Notes - Mesos - Version 1.5.3 (WIP)
 -------------------------------------------
 * This is a bug fix release.
 
 ** Bug
+  * [MESOS-8907] - Docker image fetcher fails with HTTP/2.
+
+
+Release Notes - Mesos - Version 1.5.2
+-------------------------------------
+* This is a bug fix release.
+
+** Bug
   * [MESOS-3790] - ZooKeeper connection should retry on `EAI_NONAME`.
   * [MESOS-8128] - Make os::pipe file descriptors O_CLOEXEC.
   * [MESOS-8418] - mesos-agent high cpu usage because of numerous /proc/mounts reads.


[mesos] 01/02: Updated docker image fetcher to enforce HTTP 1.1 where needed.

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

tillt pushed a commit to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 5b2e79ee01fd3e7708d8c9bd50115c6c507d2aea
Author: Till Toenshoff <to...@me.com>
AuthorDate: Mon Oct 22 21:42:53 2018 +0200

    Updated docker image fetcher to enforce HTTP 1.1 where needed.
    
    Modifies the 'curl' invocation that is returning an http::Response,
    locking it into HTTP 1.1. Our current HTTP parser is unable to process
    HTTP 2 responses.
    
    With the advent of curl 7.47, HTTPS connections are being enforced
    towards HTTP 2 rather aggressively. As a result, our image fetcher
    fails when recent curl versions are being used for pulling images from
    a registry that supports HTTP 2.
    
    HTTP 1.1 is chosen as long as the underlying curl supports the
    '--http1.1' flag. If curl is old enough to not support that flag, we
    can deduct that it will not enforce HTTP 2 and therefore need no
    further actions.
    
    For allowing all the benefits of HTTP 2 where possible, we do not
    adapt any 'curl' invocations that do not attempt to parse headers.
    
    Review: https://reviews.apache.org/r/69075/
---
 src/uri/fetchers/docker.cpp | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/src/uri/fetchers/docker.cpp b/src/uri/fetchers/docker.cpp
index aa28161..4244dab 100644
--- a/src/uri/fetchers/docker.cpp
+++ b/src/uri/fetchers/docker.cpp
@@ -24,6 +24,7 @@
 #include <process/http.hpp>
 #include <process/id.hpp>
 #include <process/io.hpp>
+#include <process/once.hpp>
 #include <process/process.hpp>
 #include <process/subprocess.hpp>
 
@@ -96,15 +97,37 @@ static Future<http::Response> curl(
     const http::Headers& headers,
     const Option<Duration>& stallTimeout)
 {
+  static process::Once* initialized = new process::Once();
+  static bool http11 = false;
+
+  if (!initialized->once()) {
+    // Test if curl supports locking into HTTP 1.1. We do this as
+    // HTTP 1.1 is more likely than HTTP 1.0 to function accross all
+    // infrastructures. The '--http1.1' flag got added to curl with
+    // with version 7.33.0. Some supported distributions do still come
+    // with curl version 7.19.0. See MESOS-8907.
+    http11 = os::system("curl --http1.1 -V  2>&1 >/dev/null") == 0;
+    VLOG(1) << "Curl accepts --http1.1 flag: " << stringify(http11);
+    initialized->done();
+  }
+
   vector<string> argv = {
     "curl",
     "-s",       // Don't show progress meter or error messages.
     "-S",       // Make curl show an error message if it fails.
     "-L",       // Follow HTTP 3xx redirects.
     "-i",       // Include the HTTP-header in the output.
-    "--raw",    // Disable HTTP decoding of content or transfer encodings.
+    "--raw"     // Disable HTTP decoding of content or transfer encodings.
   };
 
+  // Make sure curl does not enforce HTTP 2 as our HTTP parser does
+  // currently not support that. See MESOS-8368.
+  // Older curl versions do not support the HTTP 1.1 flag, but these
+  // versions are also old enough to not default to HTTP/2.
+  if (http11) {
+    argv.push_back("--http1.1");
+  }
+
   // Add additional headers.
   foreachpair (const string& key, const string& value, headers) {
     argv.push_back("-H");