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

reload 后, 解析 HTTP2 头出错: inflate failed, Error: Header compression/decompression error[-523] #5193

Closed
shengdoushi opened this issue Nov 17, 2023 · 4 comments
Labels

Comments

@shengdoushi
Copy link

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.

开启 http2 功能, 如果 reload 了 worker进程, 会导致之前连接成功状态且请求过的 http2 连接,在 reload 后再次请求时, 解析 http2 数据中的 header 出错:

inflate failed, Error: Header compression/decompression error[-523]
  1. What did you expect to see?

  2. What did you see instead?

inflate failed, Error: Header compression/decompression error[-523]

  1. What version of Swoole are you using (show your php --ri swoole)?

swoole

Swoole => enabled
Author => Swoole Team team@swoole.com
Version => 4.8.13
Built => Nov 17 2023 07:40:45
coroutine => enabled with boost asm context
debug => enabled
trace_log => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 1.1.1k 25 Mar 2021
dtls => enabled
http2 => enabled
zlib => 1.2.11
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

/docker/app # php -v
PHP 7.4.33 (cli) (built: Nov 12 2022 05:16:49) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
/docker/app # gcc -v
/bin/sh: gcc: not found

@shengdoushi
Copy link
Author

这个位置出错的:

swoole_warning("inflate failed, Error: %s[%zd]", nghttp2_strerror(rv), rv);

@shengdoushi
Copy link
Author

swoole_mode 目前设置的是 process 模式, 能在这个模式下修复吗?

@twose
Copy link
Member

twose commented Nov 17, 2023

老问题了,现在首选模式都是 BASE,性能更好,不用 BASE 的考虑点是什么?

@matyhtf
Copy link
Member

matyhtf commented Nov 21, 2023

@shengdoushi 重启后 http2 的 header table 丢失了上下文,导致无法识别。可以将 http2_header_table_size 设置为 0 或者使用 BASE 模式

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants