kafka-php
kafka-php copied to clipboard
Exception ["stream_select(): supplied resource is not a valid stream resource"]
I use the queue synchronization producer, and sometimes will throw this anomaly, will continue after this anomaly, restart the queue back to normal, I do not know why? Continued observation
Original message:
我是队列中使用同步producer,有时会抛出此异常,之后会一直持续此异常,重启队列后恢复正常,不知是什么原因?持续观察中
@wisarmy can you provide more details on this? Like an error trance and also which version of the library you're using.
@lcobucci 添加了trance日志记录,等待问题复现
@lcobucci kafka-php版本是v0.2.0.8,以下为trace信息
[2017-12-26 16:57:25] production.WARNING: kafka_producer Exception ["stream_select(): supplied resource is not a valid stream resource",[{"topic":"zq_ybf_online","value":"online:2017-12-26 16:57:25,3517156@@{"matchId":3517156,"code":2048,"desc":"客队进攻","time":135539,"addInfo":"","state":"1","chatDesc":"客队中场组织进攻"}","key":3517156}],[{"function":"handleError","class":"Illuminate\Foundation\Bootstrap\HandleExceptions","type":"->","args":[2,"stream_select(): supplied resource is not a valid stream resource","/data0/www/bocai/service/vendor/nmred/kafka-php/src/Kafka/SocketSync.php",365,{"buf":"\u0000\u0000\u0000\u0017\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0003\u0000\tkafka-php\u0000\u0000\u0000\u0000","null":null,"write":["[unknown(unknown type)]"],"failedWriteAttempts":0,"written":0,"buflen":27}]},{"file":"/data0/www/bocai/service/vendor/nmred/kafka-php/src/Kafka/SocketSync.php","line":365,"function":"stream_select","args":[null,["[unknown(unknown type)]"],null,0,100000]},{"file":"/data0/www/bocai/service/vendor/nmred/kafka-php/src/Kafka/Producer/SyncProcess.php","line":120,"function":"write","class":"Kafka\SocketSync","type":"->","args":["\u0000\u0000\u0000\u0017\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0003\u0000\tkafka-php\u0000\u0000\u0000\u0000"]},{"file":"/data0/www/bocai/service/vendor/nmred/kafka-php/src/Kafka/Producer/SyncProcess.php","line":46,"function":"syncMeta","class":"Kafka\Producer\SyncProcess","type":"->","args":[]},{"file":"/data0/www/bocai/service/vendor/nmred/kafka-php/src/Kafka/Producer.php","line":54,"function":"__construct","class":"Kafka\Producer\SyncProcess","type":"->","args":[]},{"file":"/data0/www/bocai/service/app/Console/Commands/CaptureOne.php","line":423,"function":"__construct","class":"Kafka\Producer","type":"->","args":[]},{"file":"/data0/www/bocai/service/app/Console/Commands/CaptureOne.php","line":400,"function":"kafka_producer","class":"App\Console\Commands\CaptureOne","type":"->","args":[[{"topic":"zq_ybf_online","value":"online:2017-12-26 16:57:25,3517156@@{"matchId":3517156,"code":2048,"desc":"客队进攻","time":135539,"addInfo":"","state":"1","chatDesc":"客队中场组织进攻"}","key":3517156}]]},{"function":"handle_new","class":"App\Console\Commands\CaptureOne","type":"->","args":[{"command":"capture:one","0":"capture:one"},{"handle":"new","date_offset":null,"match_id":3517156,"live_type":null,"living_sleep":null,"kafka_topic":null,"kafka_msg":null,"help":false,"quiet":false,"verbose":false,"version":false,"ansi":false,"no-ansi":false,"no-interaction":false,"env":null}]},{"file":"/data0/www/bocai/service/app/Console/Commands/CaptureOne.php","line":55,"function":"call_user_func_array","args":[["[object] (App\Console\Commands\CaptureOne: {})","handle_new"],[{"command":"capture:one","0":"capture:one"},{"handle":"new","date_offset":null,"match_id":3517156,"live_type":null,"living_sleep":null,"kafka_topic":null,"kafka_msg":null,"help":false,"quiet":false,"verbose":false,"version":false,"ansi":false,"no-ansi":false,"no-interaction":false,"env":null}]]},{"function":"handle","class":"App\Console\Commands\CaptureOne","type":"->","args":[]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php","line":29,"function":"call_user_func_array","args":[["[object] (App\Console\Commands\CaptureOne: {})","handle"],[]]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php","line":87,"function":"Illuminate\Container\{closure}","class":"Illuminate\Container\BoundMethod","type":"::","args":[]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php","line":31,"function":"callBoundMethod","class":"Illuminate\Container\BoundMethod","type":"::","args":["[object] (Illuminate\Foundation\Application: {"contextual":[]})",["[object] (App\Console\Commands\CaptureOne: {})","handle"],"[object] (Closure: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/Container.php","line":549,"function":"call","class":"Illuminate\Container\BoundMethod","type":"::","args":["[object] (Illuminate\Foundation\Application: {"contextual":[]})",["[object] (App\Console\Commands\CaptureOne: {})","handle"],[],null]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Console/Command.php","line":180,"function":"call","class":"Illuminate\Container\Container","type":"->","args":[["[object] (App\Console\Commands\CaptureOne: {})","handle"]]},{"file":"/data0/www/bocai/service/vendor/symfony/console/Command/Command.php","line":264,"function":"execute","class":"Illuminate\Console\Command","type":"->","args":["[object] (Symfony\Component\Console\Input\ArrayInput: 'capture:one' --handle=new --match_id=3517156)","[object] (Illuminate\Console\OutputStyle: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Console/Command.php","line":167,"function":"run","class":"Symfony\Component\Console\Command\Command","type":"->","args":["[object] (Symfony\Component\Console\Input\ArrayInput: 'capture:one' --handle=new --match_id=3517156)","[object] (Illuminate\Console\OutputStyle: {})"]},{"file":"/data0/www/bocai/service/vendor/symfony/console/Application.php","line":888,"function":"run","class":"Illuminate\Console\Command","type":"->","args":["[object] (Symfony\Component\Console\Input\ArrayInput: 'capture:one' --handle=new --match_id=3517156)","[object] (Symfony\Component\Console\Output\BufferedOutput: {})"]},{"file":"/data0/www/bocai/service/vendor/symfony/console/Application.php","line":224,"function":"doRunCommand","class":"Symfony\Component\Console\Application","type":"->","args":["[object] (App\Console\Commands\CaptureOne: {})","[object] (Symfony\Component\Console\Input\ArrayInput: 'capture:one' --handle=new --match_id=3517156)","[object] (Symfony\Component\Console\Output\BufferedOutput: {})"]},{"file":"/data0/www/bocai/service/vendor/symfony/console/Application.php","line":125,"function":"doRun","class":"Symfony\Component\Console\Application","type":"->","args":["[object] (Symfony\Component\Console\Input\ArrayInput: 'capture:one' --handle=new --match_id=3517156)","[object] (Symfony\Component\Console\Output\BufferedOutput: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Console/Application.php","line":88,"function":"run","class":"Symfony\Component\Console\Application","type":"->","args":["[object] (Symfony\Component\Console\Input\ArrayInput: 'capture:one' --handle=new --match_id=3517156)","[object] (Symfony\Component\Console\Output\BufferedOutput: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Console/Application.php","line":177,"function":"run","class":"Illuminate\Console\Application","type":"->","args":["[object] (Symfony\Component\Console\Input\ArrayInput: 'capture:one' --handle=new --match_id=3517156)","[object] (Symfony\Component\Console\Output\BufferedOutput: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php","line":249,"function":"call","class":"Illuminate\Console\Application","type":"->","args":["capture:one","[object] (Illuminate\Support\Collection: {"0":"capture:one","--handle":"new","--match_id":3517156})",null]},{"function":"call","class":"Illuminate\Foundation\Console\Kernel","type":"->","args":["capture:one",{"--handle":"new","--match_id":3517156}]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Foundation/Console/QueuedCommand.php","line":40,"function":"call_user_func_array","args":[["[object] (App\Console\Kernel: {})","call"],["capture:one",{"--handle":"new","--match_id":3517156}]]},{"function":"handle","class":"Illuminate\Foundation\Console\QueuedCommand","type":"->","args":["[object] (App\Console\Kernel: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php","line":29,"function":"call_user_func_array","args":[["[object] (Illuminate\Foundation\Console\QueuedCommand: {"connection":null,"queue":"capture_one_new","delay":null,"chained":[]})","handle"],["[object] (App\Console\Kernel: {})"]]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php","line":87,"function":"Illuminate\Container\{closure}","class":"Illuminate\Container\BoundMethod","type":"::","args":[]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php","line":31,"function":"callBoundMethod","class":"Illuminate\Container\BoundMethod","type":"::","args":["[object] (Illuminate\Foundation\Application: {"contextual":[]})",["[object] (Illuminate\Foundation\Console\QueuedCommand: {"connection":null,"queue":"capture_one_new","delay":null,"chained":[]})","handle"],"[object] (Closure: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/Container.php","line":549,"function":"call","class":"Illuminate\Container\BoundMethod","type":"::","args":["[object] (Illuminate\Foundation\Application: {"contextual":[]})",["[object] (Illuminate\Foundation\Console\QueuedCommand: {"connection":null,"queue":"capture_one_new","delay":null,"chained":[]})","handle"],[],null]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php","line":94,"function":"call","class":"Illuminate\Container\Container","type":"->","args":[["[object] (Illuminate\Foundation\Console\QueuedCommand: {"connection":null,"queue":"capture_one_new","delay":null,"chained":[]})","handle"]]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php","line":114,"function":"Illuminate\Bus\{closure}","class":"Illuminate\Bus\Dispatcher","type":"->","args":["[object] (Illuminate\Foundation\Console\QueuedCommand: {"connection":null,"queue":"capture_one_new","delay":null,"chained":[]})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php","line":102,"function":"Illuminate\Pipeline\{closure}","class":"Illuminate\Pipeline\Pipeline","type":"->","args":["[object] (Illuminate\Foundation\Console\QueuedCommand: {"connection":null,"queue":"capture_one_new","delay":null,"chained":[]})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php","line":98,"function":"then","class":"Illuminate\Pipeline\Pipeline","type":"->","args":["[object] (Closure: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php","line":49,"function":"dispatchNow","class":"Illuminate\Bus\Dispatcher","type":"->","args":["[object] (Illuminate\Foundation\Console\QueuedCommand: {"connection":null,"queue":"capture_one_new","delay":null,"chained":[]})",false]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php","line":76,"function":"call","class":"Illuminate\Queue\CallQueuedHandler","type":"->","args":["[object] (Illuminate\Queue\Jobs\RedisJob: {})",{"commandName":"Illuminate\Foundation\Console\QueuedCommand","command":"O:43:"Illuminate\Foundation\Console\QueuedCommand":5:{s:7:"\u0000*\u0000data";a:2:{i:0;s:11:"capture:one";i:1;a:2:{s:8:"--handle";s:3:"new";s:10:"--match_id";i:3517156;}}s:10:"connection";N;s:5:"queue";s:15:"capture_one_new";s:5:"delay";N;s:7:"chained";a:0:{}}"}]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Queue/Worker.php","line":320,"function":"fire","class":"Illuminate\Queue\Jobs\Job","type":"->","args":[]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Queue/Worker.php","line":270,"function":"process","class":"Illuminate\Queue\Worker","type":"->","args":["redis","[object] (Illuminate\Queue\Jobs\RedisJob: {})","[object] (Illuminate\Queue\WorkerOptions: {"delay":"10","memory":"128","timeout":"60","sleep":"3","maxTries":"3","force":false})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Queue/Worker.php","line":114,"function":"runJob","class":"Illuminate\Queue\Worker","type":"->","args":["[object] (Illuminate\Queue\Jobs\RedisJob: {})","redis","[object] (Illuminate\Queue\WorkerOptions: {"delay":"10","memory":"128","timeout":"60","sleep":"3","maxTries":"3","force":false})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php","line":101,"function":"daemon","class":"Illuminate\Queue\Worker","type":"->","args":["redis","capture_one_new","[object] (Illuminate\Queue\WorkerOptions: {"delay":"10","memory":"128","timeout":"60","sleep":"3","maxTries":"3","force":false})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php","line":85,"function":"runWorker","class":"Illuminate\Queue\Console\WorkCommand","type":"->","args":["redis","capture_one_new"]},{"function":"handle","class":"Illuminate\Queue\Console\WorkCommand","type":"->","args":[]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php","line":29,"function":"call_user_func_array","args":[["[object] (Illuminate\Queue\Console\WorkCommand: {})","handle"],[]]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php","line":87,"function":"Illuminate\Container\{closure}","class":"Illuminate\Container\BoundMethod","type":"::","args":[]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php","line":31,"function":"callBoundMethod","class":"Illuminate\Container\BoundMethod","type":"::","args":["[object] (Illuminate\Foundation\Application: {"contextual":[]})",["[object] (Illuminate\Queue\Console\WorkCommand: {})","handle"],"[object] (Closure: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Container/Container.php","line":549,"function":"call","class":"Illuminate\Container\BoundMethod","type":"::","args":["[object] (Illuminate\Foundation\Application: {"contextual":[]})",["[object] (Illuminate\Queue\Console\WorkCommand: {})","handle"],[],null]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Console/Command.php","line":180,"function":"call","class":"Illuminate\Container\Container","type":"->","args":[["[object] (Illuminate\Queue\Console\WorkCommand: {})","handle"]]},{"file":"/data0/www/bocai/service/vendor/symfony/console/Command/Command.php","line":264,"function":"execute","class":"Illuminate\Console\Command","type":"->","args":["[object] (Symfony\Component\Console\Input\ArgvInput: 'queue:work' --queue=capture_one_new --daemon --delay=10 --sleep=3 --tries=3)","[object] (Illuminate\Console\OutputStyle: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Console/Command.php","line":167,"function":"run","class":"Symfony\Component\Console\Command\Command","type":"->","args":["[object] (Symfony\Component\Console\Input\ArgvInput: 'queue:work' --queue=capture_one_new --daemon --delay=10 --sleep=3 --tries=3)","[object] (Illuminate\Console\OutputStyle: {})"]},{"file":"/data0/www/bocai/service/vendor/symfony/console/Application.php","line":888,"function":"run","class":"Illuminate\Console\Command","type":"->","args":["[object] (Symfony\Component\Console\Input\ArgvInput: 'queue:work' --queue=capture_one_new --daemon --delay=10 --sleep=3 --tries=3)","[object] (Symfony\Component\Console\Output\ConsoleOutput: {})"]},{"file":"/data0/www/bocai/service/vendor/symfony/console/Application.php","line":224,"function":"doRunCommand","class":"Symfony\Component\Console\Application","type":"->","args":["[object] (Illuminate\Queue\Console\WorkCommand: {})","[object] (Symfony\Component\Console\Input\ArgvInput: 'queue:work' --queue=capture_one_new --daemon --delay=10 --sleep=3 --tries=3)","[object] (Symfony\Component\Console\Output\ConsoleOutput: {})"]},{"file":"/data0/www/bocai/service/vendor/symfony/console/Application.php","line":125,"function":"doRun","class":"Symfony\Component\Console\Application","type":"->","args":["[object] (Symfony\Component\Console\Input\ArgvInput: 'queue:work' --queue=capture_one_new --daemon --delay=10 --sleep=3 --tries=3)","[object] (Symfony\Component\Console\Output\ConsoleOutput: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Console/Application.php","line":88,"function":"run","class":"Symfony\Component\Console\Application","type":"->","args":["[object] (Symfony\Component\Console\Input\ArgvInput: 'queue:work' --queue=capture_one_new --daemon --delay=10 --sleep=3 --tries=3)","[object] (Symfony\Component\Console\Output\ConsoleOutput: {})"]},{"file":"/data0/www/bocai/service/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php","line":121,"function":"run","class":"Illuminate\Console\Application","type":"->","args":["[object] (Symfony\Component\Console\Input\ArgvInput: 'queue:work' --queue=capture_one_new --daemon --delay=10 --sleep=3 --tries=3)","[object] (Symfony\Component\Console\Output\ConsoleOutput: {})"]},{"file":"/data0/www/bocai/service/artisan","line":37,"function":"handle","class":"Illuminate\Foundation\Console\Kernel","type":"->","args":["[object] (Symfony\Component\Console\Input\ArgvInput: 'queue:work' --queue=capture_one_new --daemon --delay=10 --sleep=3 --tries=3)","[object] (Symfony\Component\Console\Output\ConsoleOutput: {})"]}]]
之后 I also encountered the same problem, have you solved this problem?
这是脚本一直运行导致socket的时间太长超时了然后没有重连吧,我也遇到了。。。
我也遇到了 有解决么
+1