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

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

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

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

This comment has been minimized.

Show comment
Hide comment
@daghf

daghf Mar 11, 2016

Member

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?

Member

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

This comment has been minimized.

Show comment
Hide comment
@Krapulat

Krapulat commented Mar 11, 2016

+1

@fgsch

This comment has been minimized.

Show comment
Hide comment
@fgsch

fgsch Mar 12, 2016

Member

Related to #1772.

Member

fgsch commented Mar 12, 2016

Related to #1772.

daghf added a commit to daghf/varnish-cache that referenced this issue Mar 14, 2016

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

daghf added a commit to daghf/varnish-cache that referenced this issue Mar 15, 2016

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

@daghf daghf closed this in 76777c8 Mar 18, 2016

hermunn added a commit to hermunn/varnish-cache that referenced this issue May 2, 2016

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

hermunn added a commit that referenced this issue May 2, 2016

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
@mbarcia

This comment has been minimized.

Show comment
Hide comment
@mbarcia

mbarcia 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.

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

This comment has been minimized.

Show comment
Hide comment
@lkarsten

lkarsten May 30, 2016

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.

Contributor

lkarsten commented May 30, 2016

@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

This comment has been minimized.

Show comment
Hide comment
@lkarsten

lkarsten May 30, 2016

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.

Contributor

lkarsten commented May 30, 2016

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

This comment has been minimized.

Show comment
Hide comment
@mbarcia

mbarcia May 31, 2016

@lkarsten thank you very much

mbarcia commented May 31, 2016

@lkarsten thank you very much

lkarsten pushed a commit that referenced this issue Jun 1, 2016

@lkarsten

This comment has been minimized.

Show comment
Hide comment
@lkarsten

lkarsten Jun 1, 2016

Contributor

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

Contributor

lkarsten commented Jun 1, 2016

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

@Krapulat

This comment has been minimized.

Show comment
Hide comment
@Krapulat

Krapulat Jun 3, 2016

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

Krapulat commented Jun 3, 2016

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

@cherouvim

This comment has been minimized.

Show comment
Hide comment
@cherouvim

cherouvim Jun 30, 2016

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

cherouvim commented Jun 30, 2016

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

This comment has been minimized.

Show comment
Hide comment
@denisbr

denisbr Jun 30, 2016

@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.

denisbr commented Jun 30, 2016

@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