Join GitHub today
one minute delay on return (pipe) and a POST-Request #1806
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?