Skip to content
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

使用v2.2.2的http2时POST超过指定大小时发生错误 #1053

Closed
Appla opened this issue May 25, 2018 · 1 comment
Closed

使用v2.2.2的http2时POST超过指定大小时发生错误 #1053

Appla opened this issue May 25, 2018 · 1 comment

Comments

@Appla
Copy link

Appla commented May 25, 2018

问题描述

  • 当post数据超过指定大小时, 请求端会挂起, 直到超时. 确定启用http2引起的, 对比了上游的 1.11.6, 发现无此问题.(配置完全一样)
  • 数据超过442368, $request_length为442494是出现问题.
  • strace发现, 这个大小之前nginx和tengine都是使用writev写到后端, 超过这个数据时nginx会使用sendfile传递数据, tengine则还是用writev传递的数据. 但是数据是错误的. 看数据是最后一个可见字符加\n. 比如最后数据是abcd, 会传输的数据是d\n
HTTP_CONTENT_LENGTH 442370\0\0\0\0\0\0\1\4\0\1\0\0\0\0\1\5\0\1\0\2\6\0", 928}, {"!\n", 2}, {"\0\0\0\0\0\0\1\5\0\1\0\0\0\0", 14}

这个结构非别是传递的原始数据和数据长度, 正常的会是完整数据. tengine在上述情况下只传最后两个字节. 比如
{"!\n", 2}

运行环境

  • 系统 : centos 6.8
  • tengine 版本 2.2.2
  • 编译参数
 --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_lua_module --with-luajit-inc=/usr/local/luajit/include/luajit-2.0 --with-luajit-lib=/usr/local/luajit/lib --add-module=/usr/src/ngx_cache_purge-2.3 --with-http_concat_module --with-openssl=/usr/src/openssl-1.0.2a --with-zlib=/usr/src/zlib-1.2.8 --with-pcre=/usr/src/pcre-8.36 --add-module=/usr/src/nginx-upload-module-master/ --add-module=/usr/src/ngx_http_substitutions_filter_module-master --with-http_perl_module --with-http_v2_module
  • 后端php-fpm

请问那是什么原因导致的, 该如何解决?

@Appla Appla changed the title 使用2.2.2的http2时POST超过指定大小时发生错误 使用v2.2.2的http2时POST超过指定大小时发生错误 May 25, 2018
@chobits
Copy link
Member

chobits commented Mar 28, 2019

This bug has been fixed in latest tengine.

Tengine-2.3.0 has been released, it has been been upgraded to nginx 1.15.9.

For more details of new version, see #1220.

@chobits chobits closed this as completed Mar 28, 2019
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

No branches or pull requests

2 participants