Skip to content

Split keepalive from pipelining in HTTP connections (bug https://bugs.ec...#831

Merged
purplefox merged 1 commit intoeclipse-vertx:masterfrom
jlorgal:pipelining_bug_434402
Jun 18, 2014
Merged

Split keepalive from pipelining in HTTP connections (bug https://bugs.ec...#831
purplefox merged 1 commit intoeclipse-vertx:masterfrom
jlorgal:pipelining_bug_434402

Conversation

@jlorgal
Copy link

@jlorgal jlorgal commented May 11, 2014

...lipse.org/bugs/show_bug.cgi?id=434402). A new property 'pipelining' is added to HttpClient to disable HTTP pipelining (by default, pipelining is true to maintain backwards compatibility)

….eclipse.org/bugs/show_bug.cgi?id=434402). A new property 'pipelining' is added to HttpClient to disable HTTP pipelining (by default, pipelining is true to maintain backwards compatibility)
purplefox added a commit that referenced this pull request Jun 18, 2014
Split keepalive from pipelining in HTTP connections (bug https://bugs.ec...
@purplefox purplefox merged commit a9bdd84 into eclipse-vertx:master Jun 18, 2014
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By defaulting this to true all non-Java clients are forced into pipelining enabled. An http server that closes it's connections will cause any pipelined request after the first to fail with a timeout. Since the pipelining support is effectively broken shouldn't this have been defaulted to false?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It default to false in Vert.x 2.0 to preserve previous defaults and not break peoples applications when they upgrade.

BTW What is broken about pipelining support?

Also... in Vert.x 3.0 the HTTP client has been completely rewritten and doesn't exhibit this behaviour.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, there's actually a bug in keep alvie support, specifically it doesn't respect the 'Connection: close' header returned in a response. In that case it shouldn't put the connection back into the pool and shouldn't pass the connection to a waiter in the wait queue.

I have a test that uses a connection pool size of one that fires two requests simultaneously to a server that passes back 'Connection: close' (and subsequently closes the connection). In that case every other request gets a request timeout because the non-persistent connection is being passed directly to the waiting request.

Regarding pipelining specifically, I think it's been pointed out elsewhere that the Vertx pipelining implementation doesn't follow the RFC. Specifically it does perform a resend on connection close, or at least I haven't found the code and if it did do that I wouldn't get a request timeout in the test listed above with pipelining enabled.

Beyond whether Vert.x's implementation of pipelining is correct or not, pipelining isn't always well supported be servers and there are lots of implications in using it. A caller needs to understand which of it's calls are idempotent so that it knows it won't have an unintended side effect due to pipelining. Because of this I would think that enabling pipelining should be a consciences effort by the developer using the library and not a default. Also, since the non-Java language binders don't currently expose the setPipelining method you're forcing it on all non-Java users with no ability to disable it but to also disable keep alive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tim, please see #876 for a solution to some of the issues with server side closed connections, the Connection: close header and pipelining. It doesn't do the resend of pipelined requests but it does provide the caller with more insight into the failure rather than simply getting a request timeout with no knowledge if it was because of a connection close or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants