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

[mesos] branch 1.7.x updated (5e8c411 -> a2e2f97)

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

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


    from 5e8c411  Fixed a typo in configure.ac.
     new b2f52c9  Set 'Connection: close' in the master's streaming API responses.
     new a2e2f97  Added MESOS-9189 to the 1.7.0 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/master/http.cpp | 29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)


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

commit b2f52c9d288080bb13b0b2f06d83fa36128f3dcf
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 e2773ed..91b4c11 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -834,6 +834,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();
@@ -1015,6 +1029,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;


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

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

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

diff --git a/CHANGELOG b/CHANGELOG
index de091f2..2ded89e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -280,6 +280,7 @@ All Resolved Issues:
   * [MESOS-9110] - Add move support to the Resources / Resource_ wrappers.
   * [MESOS-9122] - Batch '/state' requests in the Master actor.
   * [MESOS-9129] - Port mapper CNI plugin should use '-n' option with 'iptables --list'
+  * [MESOS-9189] - Include 'Connection: close' header in master streaming API responses.
 
 ** Task
   * [MESOS-2633] - Move implementations of Framework struct functions out of master.hpp.