swoole-src icon indicating copy to clipboard operation
swoole-src copied to clipboard

高频次向客户端推送数据包导致Worker进程异常重启,strace显示部分错误信息

Open firstchen opened this issue 3 years ago • 1 comments
trafficstars

Please answer these questions before submitting your issue.

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

截屏2022-08-10 上午10 37 38

  1. What did you expect to see?

  2. What did you see instead?

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

Swoole => enabled Author => Swoole Team [email protected] Version => 4.8.9 Built => Jul 26 2022 10:08:21 coroutine => enabled with boost asm context epoll => enabled eventfd => enabled signalfd => enabled spinlock => enabled rwlock => enabled zlib => 1.2.12 brotli => E16777225/D16777225 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_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) ?

Linux 9725928c2272 5.10.104-linuxkit #1 SMP Thu Mar 17 17:08:06 UTC 2022 x86_64 Linux

模拟频繁推送消息至客户端,最终Worker进程重启 截屏2022-08-10 上午10 44 04

截屏2022-08-10 上午10 43 46

firstchen avatar Aug 10 '22 02:08 firstchen

看看是否设置了max_request导致worker进程达到最大处理数然后退出重启

NathanFreeman avatar Aug 10 '22 03:08 NathanFreeman

应该是设置了 SIGALAM 时钟,进程被时钟信号杀死了。可以使用 pcntl_signal 或者 Process::signal 设置 SIGALAM 的 handler

matyhtf avatar Aug 25 '22 23:08 matyhtf

应该是设置了 SIGALAM 时钟,进程被时钟信号杀死了。可以使用 pcntl_signal 或者 Process::signal 设置 SIGALAM 的 handler

请问要如何设置才可以让Worker进程不关闭?

firstchen avatar Aug 26 '22 02:08 firstchen

应该是设置了 SIGALAM 时钟,进程被时钟信号杀死了。可以使用 pcntl_signal 或者 Process::signal 设置 SIGALAM 的 handler

    \Swoole\Process::signal(SIGALAM, null); 设置了之后依旧进程退出

firstchen avatar Aug 26 '22 03:08 firstchen