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:31 UTC

[mesos] branch 1.6.x updated (de337b5 -> 809ba0c)

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

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


    from de337b5  Added MESOS-8978 to 1.6.2 CHANGELOG.
     new da80df3  Updated docker image fetcher to enforce HTTP 1.1 where needed.
     new 809ba0c  Added MESOS-8907 to the 1.6.2 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                   |  1 +
 src/uri/fetchers/docker.cpp | 25 ++++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)


[mesos] 02/02: Added MESOS-8907 to the 1.6.2 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.6.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

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

    Added MESOS-8907 to the 1.6.2 CHANGELOG.
---
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG b/CHANGELOG
index 197c5ae..d6757cd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@ Release Notes - Mesos - Version 1.6.2 (WIP)
   * [MESOS-8418] - mesos-agent high cpu usage because of numerous /proc/mounts reads.
   * [MESOS-8545] - AgentAPIStreamingTest.AttachInputToNestedContainerSession is flaky.
   * [MESOS-8568] - Command checks should always call `WAIT_NESTED_CONTAINER` before `REMOVE_NESTED_CONTAINER`
+  * [MESOS-8907] - Docker image fetcher fails with HTTP/2.
   * [MESOS-8917] - Agent leaking file descriptors into forked processes
   * [MESOS-8921] - Autotools don't work with newer OpenJDK versions
   * [MESOS-8978] - Command executor calling setsid breaks the tty support.


[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.6.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit da80df34f2e5c68041cb5a9d7282a88062bfdad1
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 0605a34..5b8ed1f 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");