Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行一段时间之后会出现 RedisException: read error on connection to redis #415

Open
262022334 opened this issue Sep 13, 2022 · 4 comments
Assignees
Labels
analyzing Analyzing this issue

Comments

@262022334
Copy link

  1. Your software version (Screenshot of your startup)

    Software Version
    PHP 7.4
    Swoole 4.5
    Laravel/Lumen 7.3
  2. Detail description about this issue(error/log)

RedisException: read error on connection to redis:6379 in /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php:116
Stack trace:
#0 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(116): Redis->get('goods_1215')
#1 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php(538): Illuminate\Redis\Connections\Connection->command('get', Array)
#2 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php(55): Illuminate\Redis\Connections\PhpRedisConnection->command('get', Array)
#3 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php(54): Illuminate\Redis\Connections\PhpRedisConnection->get('goods_1215')
#4 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(97): Illuminate\Cache\RedisStore->get('goods_1215')
#5 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(383): Illuminate\Cache\Repository->get('goods_1215')
#6 /docker/www/youjiamarket.com/app/Services/Goods/GoodsService.php(442): Illuminate\Cache\CacheManager->__call('get', Array)
#7 /docker/www/youjiamarket.com/app/Http/Controllers/App/GoodsController.php(95): App\Services\Goods\GoodsService::resolve(1215)
#8 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\App\GoodsController->list()
#9 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('list', Array)
#10 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(239): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\App\GoodsController), 'list')
#11 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(196): Illuminate\Routing\Route->runController()
#12 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(685): Illuminate\Routing\Route->run()
#13 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#14 /docker/www/youjiamarket.com/app/Http/Middleware/App.php(17): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#15 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\App->handle(Object(Illuminate\Http\Request), Object(Closure))
#16 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#17 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#18 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#19 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(687): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#20 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#21 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(628): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#22 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(617): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#23 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#24 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
#25 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#26 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#27 /docker/www/youjiamarket.com/vendor/fruitcake/laravel-cors/src/HandleCors.php(52): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#28 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#30 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(140): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#31 /docker/www/youjiamarket.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(109): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#32 /docker/www/youjiamarket.com/vendor/hhxsv5/laravel-s/src/Illuminate/Laravel.php(153): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#33 /docker/www/youjiamarket.com/vendor/hhxsv5/laravel-s/src/LaravelS.php(251): Hhxsv5\LaravelS\Illuminate\Laravel->handleDynamic(Object(Illuminate\Http\Request))
#34 /docker/www/youjiamarket.com/vendor/hhxsv5/laravel-s/src/LaravelS.php(202): Hhxsv5\LaravelS\LaravelS->handleDynamicResource(Object(Hhxsv5\LaravelS\Illuminate\Laravel), Object(Illuminate\Http\Request), Object(Swoole\Http\Response))
#35 [internal function]: Hhxsv5\LaravelS\LaravelS->onRequest(Object(Swoole\Http\Request), Object(Swoole\Http\Response))
#36 /docker/www/youjiamarket.com/vendor/hhxsv5/laravel-s/src/Swoole/Server.php(402): Swoole\Server->start()
#37 /docker/www/youjiamarket.com/vendor/hhxsv5/laravel-s/src/Console/Portal.php(158): Hhxsv5\LaravelS\Swoole\Server->run()
#38 /docker/www/youjiamarket.com/vendor/hhxsv5/laravel-s/src/Console/Portal.php(59): Hhxsv5\LaravelS\Console\Portal->start()
#39 /docker/www/youjiamarket.com/vendor/symfony/console/Command/Command.php(299): Hhxsv5\LaravelS\Console\Portal->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#40 /docker/www/youjiamarket.com/bin/laravels(167): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#41 {main}

@262022334 262022334 added the analyzing Analyzing this issue label Sep 13, 2022
@hhxsv5
Copy link
Owner

hhxsv5 commented Sep 13, 2022

phpredis/phpredis#70

@hhxsv5
Copy link
Owner

hhxsv5 commented Sep 13, 2022

https://learnku.com/docs/laravel/7.x/redis/7498#a89683
配置下read_timeout试试

@262022334
Copy link
Author

感谢大佬,目前我增加了 $redis->setOption(Redis::OPT_READ_TIMEOUT, -1); 这个设置,已经更新到线上,观察一段时间看看,但是不知道会产生其他问题吗?redis使用的是pconnect连接,如果还会出现这个问题我再配置read_timeout试试

@hhxsv5
Copy link
Owner

hhxsv5 commented Sep 26, 2022

@262022334 解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzing Analyzing this issue
Projects
None yet
Development

No branches or pull requests

2 participants