You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2018/09/05 20:18:45 UTC

[mesos] branch 1.5.x updated (6463d14 -> 5fb1c8e)

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

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


    from 6463d14  Fixed a typo in configure.ac.
     new 64cc586  Set 'Connection: close' in the master's streaming API responses.
     new 5fb1c8e  Added MESOS-9189 to the 1.5.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           |  3 +++
 src/master/http.cpp | 29 +++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)


[mesos] 02/02: Added MESOS-9189 to the 1.5.2 CHANGELOG.

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

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

commit 5fb1c8eedc63c06c05c02651bf4fb7235fdaa777
Author: Benjamin Mahler <bm...@apache.org>
AuthorDate: Wed Sep 5 13:10:45 2018 -0700

    Added MESOS-9189 to the 1.5.2 CHANGELOG.
---
 CHANGELOG | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 0b79f71..d0cd143 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -33,6 +33,9 @@ Release Notes - Mesos - Version 1.5.2 (WIP)
   * [MESOS-9170] - Zookeeper doesn't compile with newer gcc due to format error.
   * [MESOS-9196] - Removing rootfs mounts may fail with EBUSY.
 
+** Improvement
+  * [MESOS-9189] - Include 'Connection: close' header in master streaming API responses.
+
 
 Release Notes - Mesos - Version 1.5.1
 -------------------------------------------


[mesos] 01/02: Set 'Connection: close' in the master's streaming API responses.

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

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

commit 64cc58664730395a906b7ead48622e05c402fe98
Author: Benjamin Mahler <bm...@apache.org>
AuthorDate: Tue Aug 28 18:22:02 2018 -0700

    Set 'Connection: close' in the master's streaming API responses.
    
    We've seen some HTTP intermediaries (e.g. ELB) decide to re-use
    connections to mesos as an optimization to avoid re-connection
    overhead. As a result, when the end-client of the streaming API
    disconnects from the intermediary, the intermediary leaves the
    connection to Mesos open in an attempt to re-use the connection
    for another request once the response completes. Mesos then thinks
    that the subscriber never disconnected and the intermediary happily
    continues to read the streaming events even though there's no
    end-client.
    
    To help indicate to intermediaries that the connection SHOULD NOT
    be re-used, we can set the 'Connection: close' header for streaming
    API responses. It may not be respected (since the language seems to
    be SHOULD NOT), but some intermediaries may respect it and close the
    connection if the end-client disconnects.
    
    Note that libprocess' http server currently doesn't close the the
    connection based on a handler setting this header, but it doesn't
    matter here since the master's operator / scheduler and agent's
    executor streaming API responses are infinite.
    
    Review: https://reviews.apache.org/r/68553
---
 src/master/http.cpp | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/src/master/http.cpp b/src/master/http.cpp
index 1f9aac4..03e6eb0 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -852,6 +852,20 @@ Future<Response> Master::Http::subscribe(
           Pipe pipe;
           OK ok;
 
+          // Since the response is infinite, set the 'Connection: close'
+          // header to help indicate to intermediaries (e.g. load
+          // balancers, proxies) that the connection SHOULD NOT be
+          // re-used. Some intermediaries leave the connection to the
+          // server open when a client disconnects in order to re-use
+          // the connection as an optimization. In these cases, the
+          // subscribers do not get removed when the end client
+          // disconnects!
+          //
+          // TODO(bmahler): Libprocess currently doesn't close the
+          // the connection based on a handler setting this header,
+          // but it doesn't matter here since the response is infinite.
+          ok.headers["Connection"] = "close";
+
           ok.headers["Content-Type"] = stringify(contentType);
           ok.type = Response::PIPE;
           ok.reader = pipe.reader();
@@ -1033,6 +1047,21 @@ Future<Response> Master::Http::scheduler(
 
     Pipe pipe;
     OK ok;
+
+    // Since the response is infinite, set the 'Connection: close'
+    // header to help indicate to intermediaries (e.g. load
+    // balancers, proxies) that the connection SHOULD NOT be
+    // re-used. Some intermediaries leave the connection to the
+    // server open when a client disconnects in order to re-use
+    // the connection as an optimization. In these cases, the
+    // scheduler would not get removed when it disconnects from
+    // the intermediary!
+    //
+    // TODO(bmahler): Libprocess currently doesn't close the
+    // the connection based on a handler setting this header,
+    // but it doesn't matter here since the response is infinite.
+    ok.headers["Connection"] = "close";
+
     ok.headers["Content-Type"] = stringify(acceptType);
 
     ok.type = Response::PIPE;