Description
What did you do? If possible, provide a simple script for reproducing the error.
I have many codes using php+hyperf and my server.php is like that:
<?php
declare(strict_types=1);
use Hyperf\Server\Event;
use Hyperf\Server\Server;
use Swoole\Constant;
/**
* @psalm-suppress UndefinedClass
* @psalm-suppress UndefinedConstant
*/
return [
'mode' => SWOOLE_BASE,
'servers' => [
[
'name' => 'http',
'type' => Server::SERVER_HTTP,
'host' => '0.0.0.0',
'port' => 8080,
'sock_type' => SWOOLE_SOCK_TCP,
'callbacks' => [
Event::ON_REQUEST => [Hyperf\HttpServer\Server::class, 'onRequest'],
],
],
],
'settings' => [
Constant::OPTION_ENABLE_COROUTINE => true,
Constant::OPTION_WORKER_NUM => 4,
Constant::OPTION_PID_FILE => BASE_PATH . '/runtime/hyperf.pid',
Constant::OPTION_OPEN_TCP_NODELAY => true,
Constant::OPTION_MAX_COROUTINE => 100000,
Constant::OPTION_OPEN_HTTP2_PROTOCOL => true,
Constant::OPTION_MAX_REQUEST => 10000000,
Constant::OPTION_SOCKET_BUFFER_SIZE => 3 * 1024 * 1024,
Constant::OPTION_BUFFER_OUTPUT_SIZE => 3 * 1024 * 1024,
Constant::OPTION_MAX_WAIT_TIME => 540,
Constant::OPTION_DISPATCH_MODE => 2,
],
'callbacks' => [
Event::ON_WORKER_START => [Hyperf\Framework\Bootstrap\WorkerStartCallback::class, 'onWorkerStart'],
Event::ON_PIPE_MESSAGE => [Hyperf\Framework\Bootstrap\PipeMessageCallback::class, 'onPipeMessage'],
Event::ON_WORKER_EXIT => [Hyperf\Framework\Bootstrap\WorkerExitCallback::class, 'onWorkerExit'],
],
];
What did you expect to see?
I expect to see no error. Services works fine almost time, but in some moments I got the error. The error not occur in swoole 5.1.3, but occurs in >= 5.1.4 versions.
What did you see instead?
I see this error:
What version of Swoole are you using (php --ri swoole)?
5.1.3 but error has in >= 5.1.4 and if I build my own image 5.1.3 with all packages up to date.
What is your machine environment used (including the version of kernel & php & gcc)?
08b4ae57c540:/data/project# php --ri swoole
swoole
Swoole => enabled
Author => Swoole Team team@swoole.com
Version => 5.1.3
Built => Jul 25 2024 02:38:49
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 3.1.6 4 Jun 2024
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
pcre => enabled
zlib => 1.3.1
brotli => E16781312/D16781312
mutex_timedlock => enabled
pthread_barrier => enabled
async_redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_fiber_mock => Off => Off
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
Previously I open it: #5709
I "resolved" the problem if it: #5324
But, I need to update the versions to make correction in vulnerabilities. And, like I tell before, if I use image 5.1.3 and update packages, the problem occurs again.
Thanks,