Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http server does not handle multiple requests correctly when pipeling disabled #29500

Closed
Tim-Brooks opened this issue Apr 12, 2018 · 7 comments
Closed
Labels
>bug :Distributed Coordination/Network Http and internode communication implementations v7.0.0-beta1

Comments

@Tim-Brooks
Copy link
Contributor

It appears to me that we do not have protections to ensure that multiple http requests over a single connection are handled correctly when http pipelining is not enabled.

Essentially if a client sends multiple requests, we will receive those requests, parse them, and dispatch them to other threads for handling. Without the pipelining enabled, the first request to be handled will be the first response written back to the channel. This leads to out of order responses.

I'm not immediately sure what the fix is. We could always enable pipelining. Or maybe the server should send a something like a 501 if it receives a requests before the initial response has been returned?

@Tim-Brooks Tim-Brooks added >bug :Distributed Coordination/Network Http and internode communication implementations v7.0.0 labels Apr 12, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@Tim-Brooks Tim-Brooks changed the title Http server does not behave correctly when pipeling disabled Http server does not handle multiple requests correctly when pipeling disabled Apr 12, 2018
@ghost
Copy link

ghost commented Apr 12, 2018

Hi, can i fork and try playing with this issue???

@jasontedor
Copy link
Member

When HTTP pipelining is disabled, a client that is sending a request before it has received the response for a previous request is misbehaving with respect to Elasticsearch (I am not saying they are misbehaving with respect to the HTTP/1.1 specification).

We could always enable pipelining.

The default is for it to be enabled, and I agree the germane question is whether or not we should remove the ability for it to be disabled.

From the HTTP/1.1 specification:

A client that supports persistent connections MAY "pipeline" its requests (i.e., send multiple requests without waiting for each response). A server MUST send its responses to those requests in the same order that the requests were received.

With this, I lean towards saying that we remove the ability to disable pipelining (i.e., pipelining is always enabled).

@Tim-Brooks
Copy link
Contributor Author

Tim-Brooks commented Apr 13, 2018

The default is for it to be enabled, and I agree the germane question is whether or not we should remove the ability for it to be disabled.

Right. I worded it poorly, but removing the option for pipelining to be disabled is what I was suggesting.

With this, I lean towards saying that we remove the ability to disable pipelining (i.e., pipelining is always enabled).

I agree. Users could still set http.pipelining.max_events to a lower number if they want to limit inflight requests.

@jasontedor
Copy link
Member

@tbrooks8 Let us move forward with removing the ability to disable pipelining. We can deprecate in 6.x.

@Tim-Brooks
Copy link
Contributor Author

Tim-Brooks commented May 17, 2018

These tasks need to be completed:

  • Remove the http.pipelining setting. All http modules must support pipelining
  • Cleanup all the references to enabled or disabled pipelining the integration test code
  • Deprecate in 6.x

Tim-Brooks added a commit that referenced this issue May 22, 2018
This is related to #29500 and #28898. This commit removes the abilitiy
to disable http pipelining. After this commit, any elasticsearch node
will support pipelined requests from a client. Additionally, it extracts
some of the http pipelining work to the server module. This extracted
work is used to implement pipelining for the nio plugin.
Tim-Brooks added a commit to Tim-Brooks/elasticsearch that referenced this issue May 22, 2018
This is related to elastic#29500. In 7.0 this setting will be removed. This PR
marks the setting in 6.x as deprecated.
Tim-Brooks added a commit to Tim-Brooks/elasticsearch that referenced this issue May 22, 2018
This is related to elastic#29500. We are removing the ability to disable http
pipelining. This PR removes the references to disabling pipelining in
the integration test case.
Tim-Brooks added a commit that referenced this issue May 22, 2018
This is related to #29500. We are removing the ability to disable http
pipelining. This PR removes the references to disabling pipelining in
the integration test case.
Tim-Brooks added a commit that referenced this issue May 23, 2018
This is related to #29500. In 7.0 this setting will be removed. This PR
marks the setting in 6.x as deprecated.
@Tim-Brooks
Copy link
Contributor Author

Closing this as pipelining support is now mandator in 7.0 and the setting is deprecated in 6.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Coordination/Network Http and internode communication implementations v7.0.0-beta1
Projects
None yet
Development

No branches or pull requests

4 participants