$_SESSION 异常报错导致进程busy

carlos66
Exception: $_SESSION must be an array. But $_SESSION=false is not array. in /mnt/e/phpwork/subway-gatewaywoker/vendor/workerman/gateway-worker/src/BusinessWorker.php:424
Stack trace:
#0 : GatewayWorker\BusinessWorker->onGatewayMessage(Object(Workerman\Connection\AsyncTcpConnection), Array)
#1 /mnt/e/phpwork/subway-gatewaywoker/vendor/workerman/workerman/Connection/TcpConnection.php(658): call_user_func(Array, Object(Workerman\Connection\AsyncTcpConnection), Array)
#2 : Workerman\Connection\TcpConnection->baseRead(Resource id #69, 2, Resource id #69)
#3 /mnt/e/phpwork/subway-gatewaywoker/vendor/workerman/workerman/Events/Event.php(195): EventBase->loop()
#4 /mnt/e/phpwork/subway-gatewaywoker/vendor/workerman/workerman/Worker.php(2357): Workerman\Events\Event->loop()
#5 /mnt/e/phpwork/subway-gatewaywoker/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run()
#6 /mnt/e/phpwork/subway-gatewaywoker/vendor/workerman/workerman/Worker.php(1488): GatewayWorker\BusinessWorker->run()
#7 /mnt/e/phpwork/subway-gatewaywoker/vendor/workerman/workerman/Worker.php(1318): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\BusinessWorker))
#8 /mnt/e/phpwork/subway-gatewaywoker/vendor/workerman/workerman/Worker.php(1292): Workerman\Worker::forkWorkersForLinux()
#9 /mnt/e/phpwork/subway-gatewaywoker/vendor/workerman/workerman/Worker.php(509): Workerman\Worker::forkWorkers()
#10 /mnt/e/phpwork/subway-gatewaywoker/start.php(38): Workerman\Worker::runAll()
#11 {main}
Worker process terminated

worker exit with status 64000服务端在运行一定时间后会出现busy情况,但是排查了一圈发现业务内并没有造成循环的问题。用文档中的strace看了之后kill掉pid后就不busy了,但是报了这个问题,所以是不是这个问题导致进程一直busy呢?如何解决呢?谢谢。
 
服务端中使用到session的地方就是这里,
这里是设置session和使用sessionGateway::setSession($client_id,);$device = Gateway::getsession($client_id);

2649 1 0
1个回答

静默

看报错的意思是期待$_SESSION是一个数组,但是$_SESSION是false,估计你哪里设置了 $_SESSION = xxxx, xxxx的值是false导致的

  • carlos66 2019-05-06

    在这个项目里面其实就只有我上面贴的这两个地方在设置session。$_SESSION这个变量我并没用使用到,后面我把Gateway::setSession和Gateway::getSession去掉了。就不会再出现这个busy问题了。

年代过于久远,无法发表回答
×
🔝