Repository navigation
Closed
Labels
Description
In symfony v4.2.2 when processor encounters exception, exception is outputed in console in recursion. Console is not responding to input. If monolog is used, app crashes because uses up all memory. It appears that exception handler (\Enqueue\Consumption\QueueConsumer::onProcessorException) injecs exception to it self as previous exception and creates recursion.
Tried it on my app. Also tried it on clean symfony install. See detail steps to reproduce below.
Steps to reproduce:
bash composer create-project symfony/skeleton my-projectbash composer require enqueue/enqueue-bundlebash composer req enqueue/amqp-lib- Change .env ENQUEUE_DSN=amqp+lib:
- Create basic processor my-project/src/Processor/PrimaImportProcessor.php:
<?php declare(strict_types = 1);
namespace App\Processor;
use Interop\Queue\Context;
use Interop\Queue\Message;
use Interop\Queue\Processor;
class PrimaImportProcessor implements Processor
{
public function process(Message $message, Context $context)
{
throw new \RuntimeException('a');
}
}- Define it in config/services.yaml
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller'
tags: ['controller.service_arguments']
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
App\Processor\PrimaImportProcessor:
public: true
tags:
- { name: 'enqueue.transport.processor', processor: 'prima_import_processor' }- Run processor
console enqueue:transport:consume prima_import_processor edss-import -vvv- Get eternal loop in console
https://i.imgur.com/I28dObw.png
My composer json is
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"enqueue/amqp-lib": "^0.9.2",
"enqueue/enqueue-bundle": "^0.9.3",
"symfony/console": "4.2.*",
"symfony/dotenv": "4.2.*",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "4.2.*",
"symfony/yaml": "4.2.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.2.*"
}
}
}
Activity
makasim commentedon Jan 28, 2019
how do you run consume command, do you use docker?
aphex008 commentedon Jan 29, 2019
Hello, Maksim, thanks for fast resposne. I'm not using docker. I use brew installed php. Here is my php.ini
aphex008 commentedon Jan 29, 2019
BTW works fine on symfony 3.4.
aphex008 commentedon Jan 29, 2019
Php version
PHP 7.2.13 (cli) (built: Dec 7 2018 10:41:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.13, Copyright (c) 1999-2018, by Zend Technologies
DamienHarper commentedon Feb 1, 2019
@aphex008 it looks like what have been fixed in #725, could you test against
masterbranch?makasim commentedon Feb 1, 2019
If so, should be fixed in 0.9.7. Feel free to reopen if it does fix the issue.
aphex008 commentedon Feb 1, 2019
Confirming that problem is solved. Thanks :)