one minute delay on return (pipe) and a POST-Request #1806

Closed
bsdphk opened this Issue Mar 4, 2016 · 11 comments

Projects

None yet

8 participants

@bsdphk
Contributor
bsdphk commented Mar 4, 2016

Old ticket imported from Trac
See archived copy here: https://varnish-cache.org/trac/ticket/1806

@daghf
Contributor
daghf commented Mar 11, 2016

I looked into this.

The issue seems to be that for return (pipe) we don't pass the request body. For pipe this is deferred until we do V1P_Process. This is fine for piped connections where we use a fresh backend connection, but when we get a recycled connection (state == STOLEN) we do VBT_Wait and go on the waiter first.

Thus the backend receives a request indicating a req body and waits around for that. At the same time the vbc is on the waiter expecting data from the backend, and we end up in a deadlock situation until timeout.

A fix could be to always force a fresh backend connection for piped requests (thereby avoiding the waiter), but there might be a more elegant solution?

@Krapulat

+1

@fgsch
Member
fgsch commented Mar 12, 2016

Related to #1772.

@daghf daghf added a commit to daghf/varnish-cache that referenced this issue Mar 14, 2016
@daghf daghf Postpone calling VBT_wait until after V1P_Process
Fixes a bug where we went on the waiter prior to passing the request
body.

The VBT_Wait call is now handled in vbe_dir_finish.

Test case by thomaslc

Fixes: #1806
6c57bff
@daghf daghf added a commit to daghf/varnish-cache that referenced this issue Mar 15, 2016
@daghf daghf Postpone calling VBT_wait until after V1P_Process
Fixes a bug where we went on the waiter prior to passing the request
body.

The VBT_Wait call is now handled in vbe_dir_finish.

Test case by thomaslc

Fixes: #1806
5eac674
@daghf daghf added a commit that closed this issue Mar 18, 2016
@daghf daghf Postpone calling VBT_wait until after V1P_Process
Fixes a bug where we wait for an event to fire on the backend socket
prior to passing the request body.

The VBT_Wait call is now handled in vbe_dir_finish.

Test case by thomaslc

Fixes: #1806
76777c8
@daghf daghf closed this in 76777c8 Mar 18, 2016
@hermunn hermunn added a commit to hermunn/varnish-cache that referenced this issue May 2, 2016
@daghf @hermunn daghf + hermunn Postpone calling VBT_wait until after V1P_Process
Fixes a bug where we wait for an event to fire on the backend socket
prior to passing the request body.

The VBT_Wait call is now handled in vbe_dir_finish.

Test case by thomaslc

Fixes: #1806
5ec7225
@hermunn hermunn added a commit that referenced this issue May 2, 2016
@daghf @hermunn daghf + hermunn Postpone calling VBT_wait until after V1P_Process
Fixes a bug where we wait for an event to fire on the backend socket
prior to passing the request body.

The VBT_Wait call is now handled in vbe_dir_finish.

Test case by thomaslc

Fixes: #1806
ea101c7
@mical85 mical85 referenced this issue in nexcess/magento-turpentine May 12, 2016
Closed

'add to cart' is very slowly, and reporting "Bad Request" #1156

@mbarcia
mbarcia commented May 12, 2016

Current version on Debian Jessie 4.1.2 (Mar 4th) still has this bug, which was fixed on March 14th.

Any idea when this fix is going to reach Debian Jessie? Thank you very much.

@lkarsten
Contributor

@mbarcia We'll do another release when we're done with the backporting efforts, probably in June. After that you have to bug @ssm or another packager to upload the fresh version.

@lkarsten
Contributor

Strictly speaking, since it is jessie, our official packages covers it and will most likely be out a day or two after the release.

@mbarcia
mbarcia commented May 31, 2016

@lkarsten thank you very much

@lkarsten lkarsten pushed a commit that referenced this issue Jun 1, 2016
Lasse Karstensen Add 1806 to changelog.
Ref: #1806
ab83560
@lkarsten
Contributor
lkarsten commented Jun 1, 2016

backport review: commited to 4.1 head, needs 4.0 review.

@Krapulat
Krapulat commented Jun 3, 2016

@lkarsten When it will be available the fix in Varnish 4.1 for Ubuntu?

@cherouvim

Hello. Any idea when is this comming to ubuntu? I have a couple of ubuntu 16 servers with migrated sites and until this is fixed I have to change all pipe to pass in the vcls in order for posts to work quickly, but this introduces some other problems.

Thanks

@denisbr
denisbr commented Jun 30, 2016 edited

@cherouvim Ubuntu packaging for Xenial is handled by the maintainers of the ubuntu package maintainers (http://packages.ubuntu.com/xenial/varnish). @ssm might be able to guesstimate something, but due to the nature of the process it's not easy.

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