WyriHaximus / ReactGuzzleRing

RingPHP handler powered by react/http-client
MIT License
25 stars 3 forks source link

'fread(): SSL: Connection reset by peer #9

Open DangerLifter opened 9 years ago

DangerLifter commented 9 years ago

I couldn't say that it is about handler. Probably It is issue of Reactphp stream or aneone other but ... Seems Guzzle Ring ReactPhp Handler is the only who uses Reactphp Stream in my code and probably can provide some wrap code to corretly proceed this situation. So crashes are: "fread(): SSL: Connection reset by peer"

exception 'ErrorException' with message 'fread(): SSL: Connection reset by peer' in /home/projects/Scraper/vendor/react/stream/src/Stream.php:121
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleError(2, 'fread(): SSL: C...', '/home/projects/...', 121, Array)
#1 /home/projects/Scraper/vendor/react/stream/src/Stream.php(121): fread(Resource id #374608, 4096)
#2 [internal function]: React\Stream\Stream->handleData(Resource id #374608, Object(React\EventLoop\LibEventLoop))
#3 /home/projects/Scraper/vendor/react/event-loop/LibEventLoop.php(335): call_user_func(Array, Resource id #374608, Object(React\EventLoop\LibEventLoop))
#4 [internal function]: React\EventLoop\LibEventLoop->React\EventLoop\{closure}(Resource id #374608, 2, NULL)
#5 /home/projects/Scraper/vendor/react/event-loop/LibEventLoop.php(211): event_base_loop(Resource id #113, 1)
#6 /home/projects/Scraper/library/DomainScrapper/Worker/Main.php(146): React\EventLoop\LibEventLoop->run()
#7 /home/projects/Scraper/library/DomainScrapper/Worker/Manager.php(933): DomainScrapper\Worker\Main->run(Array)
#8 /home/projects/Scraper/app/commands/WorkerRun.php(44): DomainScrapper\Worker\Manager::run('Crawler-2', '40/0/0/0')
#9 /home/projects/Scraper/vendor/laravel/framework/src/Illuminate/Console/Command.php(112): WorkerRun->fire()
#10 /home/projects/Scraper/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(253): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /home/projects/Scraper/vendor/laravel/framework/src/Illuminate/Console/Command.php(100): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /home/projects/Scraper/vendor/symfony/console/Symfony/Component/Console/Application.php(889): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /home/projects/Scraper/vendor/symfony/console/Symfony/Component/Console/Application.php(193): Symfony\Component\Console\Application->doRunCommand(Object(WorkerRun), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /home/projects/Scraper/vendor/symfony/console/Symfony/Component/Console/Application.php(124): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /home/projects/Scraper/crawler(20): Symfony\Component\Console\Application->run()
#16 {main} [] []

I have no better information for now, because crashes happens few times in several hours and I didn't catch any exact use case.

WyriHaximus commented 9 years ago

What PHP version are you running and is it the same site each time? If you can come up with a reproducible way I can write something to prevent it.

DangerLifter commented 9 years ago
PHP 5.5.21 (cli) (built: Jan 23 2015 01:30:54) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

No I have no reproducible way. I wasn't able for now to detect circumstances which cause crashes. it just happens from time to time.