首页
下载
文档
问答社区
视频
捐赠
源代码
AI 助理
赞助商
CRMEB
Apipost
腾讯云
微擎
禅道
51Talk
商业产品
Swoole AI 智能文档翻译器
Swoole-Compiler PHP 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
SwooleProcessPool 卡死的问题
### 问题描述 \Swoole\Process\Pool 卡死的问题 ### Swoole版本,PHP版本,以及操作系统版本信息 Swoole版本 4.6.1 PHP版本:7.2.7 操作系统:centos 6 ### 相关代码 ```php $objPoolWorker = new \Swoole\Process\Pool(10,SWOOLE_IPC_UNIXSOCK,0,true); $objPoolWorker->on("WorkerStart", function ($pool, $workerId) { //var_dump($objPoolWorker); opcache_reset(); $isReset = false; pcntl_signal(SIGTERM, function ()use(&$isReset,$poolTable,$pool) { $isReset = true; foreach ($poolTable as $v){ $pool->getProcess($v["workerId"])->exportSocket()->sendall("restart"); } }); $objConsumer = new \ownLibs\mq\kafkaSdk\Consumer(); $pool->getProcess()->name("Consumer_" . $biz . "_" . $class . "_" . $groupName); $objConsumer->runConsumer(); }); ``` ### 你期待的结果是什么?实际看到的错误信息又是什么? #0 0x00007f3d5859c293 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81 #1 0x00007f3d4a0c83af in swoole::ReactorEpoll::wait(timeval*) () at /usr/local/src/swoole-src-4.6.1/src/reactor/epoll.cc:196 #2 0x00007f3d4a012fe7 in php_swoole_event_wait () at /usr/local/src/swoole-src-4.6.1/include/swoole_reactor.h:159 #3 0x00007f3d4a04439d in pool_onWorkerStart(swoole::ProcessPool*, int) () at /usr/local/src/swoole-src-4.6.1/ext-src/swoole_process_pool.cc:223 #4 0x00007f3d4a0b7599 in swoole::ProcessPool::spawn(swoole::Worker*) () at /usr/local/src/swoole-src-4.6.1/src/os/process_pool.cc:328 #5 0x00007f3d4a0b776c in swoole::ProcessPool::start() () at /usr/local/src/swoole-src-4.6.1/src/os/process_pool.cc:177 #6 0x00007f3d4a0459c8 in zim_swoole_process_pool_start () at /usr/local/src/swoole-src-4.6.1/ext-src/swoole_process_pool.cc:518 #7 0x00000000008f7e64 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x7f3d54c1e960) at /root/php-7.2.7/Zend/zend_vm_execute.h:907 #8 0x00000000008c4268 in execute_ex (ex=<value optimized out>) at /root/php-7.2.7/Zend/zend_vm_execute.h:59723 #9 0x000000000086de30 in zend_call_function (fci=0x7ffcce036360, fci_cache=0x7ffcce0363a0) at /root/php-7.2.7/Zend/zend_execute_API.c:819 #10 0x00000000006d0730 in reflection_method_invoke (execute_data=<value optimized out>, return_value=0x7f3d54c1e530, variadic=<value optimized out>) at /root/php-7.2.7/ext/reflection/php_reflection.c:3221 #11 0x00000000008f7974 in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (execute_data=0x7f3d54c1e410) at /root/php-7.2.7/Zend/zend_vm_execute.h:1032 #12 0x00000000008c4268 in execute_ex (ex=<value optimized out>) at /root/php-7.2.7/Zend/zend_vm_execute.h:59723 #13 0x00000000009297a3 in zend_execute (op_array=0x7f3d54cfdc40, return_value=<value optimized out>) at /root/php-7.2.7/Zend/zend_vm_execute.h:63760 #14 0x000000000087c9b3 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php-7.2.7/Zend/zend.c:1496 #15 0x000000000081b408 in php_execute_script (primary_file=0x7ffcce0398f0) at /root/php-7.2.7/main/main.c:2590 #16 0x000000000092ca53 in do_cli (argc=7, argv=0x1aa5c60) at /root/php-7.2.7/sapi/cli/php_cli.c:1011 卡住,无法重启
发布于3年前 · 2 次浏览 · 来自
提问
易难
### 问题描述 \Swoole\Process\Pool 卡死的问题 ### Swoole版本,PHP版本,以及操作系统版本信息 Swoole版本 4.6.1 PHP版本:7.2.7 操作系统:centos 6 ### 相关代码 ```php $objPoolWorker = new \Swoole\Process\Pool(10,SWOOLE_IPC_UNIXSOCK,0,true); $objPoolWorker->on("WorkerStart", function ($pool, $workerId) { //var_dump($objPoolWorker); opcache_reset(); $isReset = false; pcntl_signal(SIGTERM, function ()use(&$isReset,$poolTable,$pool) { $isReset = true; foreach ($poolTable as $v){ $pool->getProcess($v["workerId"])->exportSocket()->sendall("restart"); } }); $objConsumer = new \ownLibs\mq\kafkaSdk\Consumer(); $pool->getProcess()->name("Consumer_" . $biz . "_" . $class . "_" . $groupName); $objConsumer->runConsumer(); }); ``` ### 你期待的结果是什么?实际看到的错误信息又是什么? #0 0x00007f3d5859c293 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81 #1 0x00007f3d4a0c83af in swoole::ReactorEpoll::wait(timeval*) () at /usr/local/src/swoole-src-4.6.1/src/reactor/epoll.cc:196 #2 0x00007f3d4a012fe7 in php_swoole_event_wait () at /usr/local/src/swoole-src-4.6.1/include/swoole_reactor.h:159 #3 0x00007f3d4a04439d in pool_onWorkerStart(swoole::ProcessPool*, int) () at /usr/local/src/swoole-src-4.6.1/ext-src/swoole_process_pool.cc:223 #4 0x00007f3d4a0b7599 in swoole::ProcessPool::spawn(swoole::Worker*) () at /usr/local/src/swoole-src-4.6.1/src/os/process_pool.cc:328 #5 0x00007f3d4a0b776c in swoole::ProcessPool::start() () at /usr/local/src/swoole-src-4.6.1/src/os/process_pool.cc:177 #6 0x00007f3d4a0459c8 in zim_swoole_process_pool_start () at /usr/local/src/swoole-src-4.6.1/ext-src/swoole_process_pool.cc:518 #7 0x00000000008f7e64 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x7f3d54c1e960) at /root/php-7.2.7/Zend/zend_vm_execute.h:907 #8 0x00000000008c4268 in execute_ex (ex=<value optimized out>) at /root/php-7.2.7/Zend/zend_vm_execute.h:59723 #9 0x000000000086de30 in zend_call_function (fci=0x7ffcce036360, fci_cache=0x7ffcce0363a0) at /root/php-7.2.7/Zend/zend_execute_API.c:819 #10 0x00000000006d0730 in reflection_method_invoke (execute_data=<value optimized out>, return_value=0x7f3d54c1e530, variadic=<value optimized out>) at /root/php-7.2.7/ext/reflection/php_reflection.c:3221 #11 0x00000000008f7974 in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (execute_data=0x7f3d54c1e410) at /root/php-7.2.7/Zend/zend_vm_execute.h:1032 #12 0x00000000008c4268 in execute_ex (ex=<value optimized out>) at /root/php-7.2.7/Zend/zend_vm_execute.h:59723 #13 0x00000000009297a3 in zend_execute (op_array=0x7f3d54cfdc40, return_value=<value optimized out>) at /root/php-7.2.7/Zend/zend_vm_execute.h:63760 #14 0x000000000087c9b3 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php-7.2.7/Zend/zend.c:1496 #15 0x000000000081b408 in php_execute_script (primary_file=0x7ffcce0398f0) at /root/php-7.2.7/main/main.c:2590 #16 0x000000000092ca53 in do_cli (argc=7, argv=0x1aa5c60) at /root/php-7.2.7/sapi/cli/php_cli.c:1011 卡住,无法重启
赞
0
分享
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
评论
还没有评论!
微信公众号
热门内容
作者其它话题
- 协程socket 错误码90错误消息Message too long
- 如何才能让协程运行在php-fpm里?
- 协程Pdo并发写入报错
- Swoole\Process\Manager 无法使用通信的问题
暂无回复的问答
- CodeGalaxy K3s 轻量集群节点之间如何实现负载均衡
- 关于openssl CURL WARNING swSSL_connect: SSL_connect(fd=69) failed. Error: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small[1|394]
- 多个模型如何进行事务异常回退?
- websocket开启wss报错
- 协程tcp服务器如何使用多进程?recv()方法接收信息,打印出来的pid一直是同一个。没用使用到多进程啊。