首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
WARNING Server::check_worker_exit_status(): worker(pid=24, id=1) abnormal exit, status=255, signal=0
### 问题描述 使用swoft 的rpc服务。 客户端会隔一端时间 recv 超时 errCode=110 msg=Connection timed out interface 查看服务端日志发现 WARNING Server::check_worker_exit_status(): worker(pid=24, id=1) abnormal exit, status=255, signal=0 ### Swoole版本,PHP版本,以及操作系统版本信息 swoole 4.8.3 PHP 7.2.34 (cli) (built: Dec 11 2020 10:44:02) ( NTS ) 阿里云 centos7 ### 相关代码 ```php 客服端 $connection = new Client(SWOOLE_SOCK_TCP); ... $result = $connection->recv(); $trace[] = microtime(true); if (empty($result)) { // Has been reconnected OR receive date timeout $errCode = $connection->getErrCode(); $errMsg = $connection->getErrMsg(); if ($reconnect || $errCode === SOCKET_ETIMEDOUT) { // fix: reusing use the connection will read old response data. if ($errCode === SOCKET_ETIMEDOUT) { $connection->reconnect(); } $message = sprintf($message, $errCode, $errMsg); throw new RpcClientException('recv:' . $message);//这里隔一端时间 recv 超时 } return $this->sendAndRecv($connection, $data, $message, true); } 服务端 public function start(): void { $this->swooleServer = new SwooleServer($this->host, $this->port, $this->mode, $this->type);//$this->type=tcp $this->startSwoole(); } /** * Bind swoole event and start swoole server * * @throws ServerException */ protected function startSwoole(): void { ... // Start swoole server $this->swooleServer->start(); } ``` ### 你期待的结果是什么?实际看到的错误信息又是什么?
发布于4年前 · 39 次浏览 · 来自
提问
zhoubin
### 问题描述 使用swoft 的rpc服务。 客户端会隔一端时间 recv 超时 errCode=110 msg=Connection timed out interface 查看服务端日志发现 WARNING Server::check_worker_exit_status(): worker(pid=24, id=1) abnormal exit, status=255, signal=0 ### Swoole版本,PHP版本,以及操作系统版本信息 swoole 4.8.3 PHP 7.2.34 (cli) (built: Dec 11 2020 10:44:02) ( NTS ) 阿里云 centos7 ### 相关代码 ```php 客服端 $connection = new Client(SWOOLE_SOCK_TCP); ... $result = $connection->recv(); $trace[] = microtime(true); if (empty($result)) { // Has been reconnected OR receive date timeout $errCode = $connection->getErrCode(); $errMsg = $connection->getErrMsg(); if ($reconnect || $errCode === SOCKET_ETIMEDOUT) { // fix: reusing use the connection will read old response data. if ($errCode === SOCKET_ETIMEDOUT) { $connection->reconnect(); } $message = sprintf($message, $errCode, $errMsg); throw new RpcClientException('recv:' . $message);//这里隔一端时间 recv 超时 } return $this->sendAndRecv($connection, $data, $message, true); } 服务端 public function start(): void { $this->swooleServer = new SwooleServer($this->host, $this->port, $this->mode, $this->type);//$this->type=tcp $this->startSwoole(); } /** * Bind swoole event and start swoole server * * @throws ServerException */ protected function startSwoole(): void { ... // Start swoole server $this->swooleServer->start(); } ``` ### 你期待的结果是什么?实际看到的错误信息又是什么?
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
还没有评论!