You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Alexander Rukletsov (JIRA)" <ji...@apache.org> on 2018/08/29 10:45:00 UTC

[jira] [Commented] (MESOS-9189) Include 'Connection: close' header in streaming API responses.

    [ https://issues.apache.org/jira/browse/MESOS-9189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16596183#comment-16596183 ] 

Alexander Rukletsov commented on MESOS-9189:
--------------------------------------------

I'm not sure I understand how the change is supposed to help. {{'Connection: close'}} set by a server is an indicator for the client to close the connection _after_ receiveng the complete response. AFAIK, we don't ever complete the streaming response in Mesos and  there is no way for Mesos to somehow understand that an end client might not be interested in the stream any more and send an empty chunk. From a middleman's point of view the actual value of the {{'Connection'}} header is only interesting _after_ the response is completed, i.e., an empty chunk has been received, which, IIRC, never happens in our case.

Is the hope here is that some middlemen peek into the {{'Connection'}} header and based on it decide whether to close the connection themselves when their client disconnects even though the response might not be completed?

> Include 'Connection: close' header in streaming API responses.
> --------------------------------------------------------------
>
>                 Key: MESOS-9189
>                 URL: https://issues.apache.org/jira/browse/MESOS-9189
>             Project: Mesos
>          Issue Type: Improvement
>          Components: HTTP API
>            Reporter: Benjamin Mahler
>            Assignee: Benjamin Mahler
>            Priority: Major
>
> 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 streaming API responses are infinite.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)