mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <>
Subject Review Request 68553: Set 'Connection: close' in the master's streaming API responses.
Date Wed, 29 Aug 2018 02:03:44 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for mesos, Gastón Kleiman and Vinod Kone.

Bugs: MESOS-9189

Repository: mesos


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

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.


  src/master/http.cpp e074a93666d82944774e7b0c3fa32d7021d93c97 



Manually verified headers make it through:

$ telnet 5050
Connected to
Escape character is '^]'.
POST /master/api/v1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 20

HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/json
Date: Wed, 29 Aug 2018 01:58:34 GMT
Connection: close



Benjamin Mahler

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message