varnish 6 行为无数据 POST

varnish 6 行为无数据 POST

我在 varnish 6 上遇到了一个奇怪的行为,我需要一些建议来找出问题所在。这发生在空的 POST/PUT 请求上。

配方平台上一切运行良好,但在生产平台上出现错误:

transfer closed with outstanding read data remaining

以下是详细测试:

$ curl -v -X PUT --data "" "http://<prod-varnish-server>:81/"
* Expire in 0 ms for 6 (transfer 0x55ee8ab12f50)
*   Trying 10.10.10.10...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x55ee8ab12f50)
* Connected to 10.10.10.10 (10.10.10.10) port 81 (#0)
> PUT / HTTP/1.1
> Host: ************
> User-Agent: curl/7.64.0
> Accept: */*
> Content-Length: 0
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Date: Tue, 29 Sep 2020 08:21:55 GMT
< Server: Apache
< Vary: cookie,authorization,Accept-Encoding
< Content-Type: text/html; charset=UTF-8
< X-Backend: web1
< X-ttl: 0.000
< X-Varnish: 463
< Age: 0
< Via: 1.1 varnish (Varnish/6.1)
< X-Debug-Served-By: front_nodes
< X-Debug-varnishHost: frd825p103fel.itc.integra.fr
< X-Debug-User-Hash:
< X-Debug-Cache-Control: public, s-maxage=86400
< X-Cache: MISS
< Cache-Control: public
< Accept-Ranges: bytes
< Transfer-Encoding: chunked
< Connection: keep-alive
<
* transfer closed with outstanding read data remaining
* Closing connection 0


$ curl -v -X PUT --data "" "http://<prod-apache-backend>:82/"
* Expire in 0 ms for 6 (transfer 0x55b5beda8f50)
*   Trying 10.10.10.11...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x55b5beda8f50)
* Connected to 10.10.10.11 (10.10.10.11) port 82 (#0)
> PUT / HTTP/1.1
> Host: ************
> User-Agent: curl/7.64.0
> Accept: */*
> Content-Length: 0
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Date: Tue, 29 Sep 2020 08:22:29 GMT
< Server: Apache
< Cache-Control: public, s-maxage=86400
< Vary: cookie,authorization,Accept-Encoding
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8
<
 ... html code data


$ curl -v -X PUT --data "" "http://<rec-varnish-server>:81/"
*   Trying 10.10.10.10...
* TCP_NODELAY set
* Connected to 10.10.10.10 (10.10.10.10) port 81 (#0)
> PUT / HTTP/1.1
> Host: ************
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Length: 0
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Date: Tue, 29 Sep 2020 08:25:45 GMT
< Server: Apache
< Vary: cookie,authorization,Accept-Encoding
< Content-Type: text/html; charset=UTF-8
< X-Backend: web2
< X-ttl: 0.000
< X-Varnish: 32777
< Age: 0
< Via: 1.1 varnish (Varnish/6.0)
< X-Debug-Served-By: front_nodes
< X-Debug-varnishHost: INTEZPUBCACHE.itc.integra.fr
< X-Debug-User-Hash:
< X-Debug-Cache-Control: public, s-maxage=86400
< X-Cache: MISS
< Cache-Control: public
< Accept-Ranges: bytes
< Transfer-Encoding: chunked
< Connection: keep-alive
<
 ... html code data
* Curl_http_done: called premature == 0
* Connection #0 to host 127.0.0.1 left intact

在生产环境中:

  • varnishd(varnish-6.1.1 修订版 efc2f6c1536cf2272e471f5cff5f145239b19460)
  • curl 7.64.0(x86_64-pc-linux-gnu)libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2(+libidn2/2.0.5)libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3

关于配方环境:

  • varnishd(varnish-6.0.6 修订版 29a1a8243dbef3d973aec28dc90403188c1dc8e7)
  • curl 7.52.1(x86_64-pc-linux-gnu)libcurl/7.52.1 OpenSSL/1.0.2q zlib/1.2.8 libidn2/0.16 libpsl/0.17.0(+libidn2/0.16)libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3

谢谢

相关内容