Code Monkey home page Code Monkey logo

heri-jobqueue-bundle's Introduction

Hi there, welcome on my profile✌️

Typing SVG

👯 I’m currently working at Carrefour as a Chapter Lead Front

heri-jobqueue-bundle's People

Contributors

abrose avatar heristop avatar jlirochon avatar levlexx avatar omega19 avatar scrutinizer-auto-fixer avatar shinmen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

heri-jobqueue-bundle's Issues

Remove /usr/bin/php in QueueService.php

Defaulting to /usr/bin/php has caused problems for me in that it sometimes doesn't live there. I'd suggest removing the php part of the command so you end up with this:

$process = new Process(sprintf('%s %s %s',
   'bin/console', $commandName,
    implode(' ', $arguments)
));

This works because the console file has the following:

#!/usr/bin/env php

Which means it's handled in a nicer way.

Cheers!

Out of memory exception after some time

Hi all,

i'm getting out of memory exceptions after the listener has been running some time. For testing purposes I've set the memory_limit to 32M in the php.ini and the crash occurs after 15-20 minutes after the listener has been started. Im using the bundle with symfony2 on a debian wheezy machine with apache2 and mysql 5. Monitoring the process with top/htop shows that the memory consumption grows slowly but steadily. I'm not sure in which part of the bundle the problem occurs or if it's caused by a wrong configuration.

Here is a stack trace:

php app/console jobqueue:listen --env=dev --quiet jobs
.
.
.
.
;10/15 minutes later 
PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 80 bytes) in /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php on line 129
PHP Stack trace:
PHP   1. {main}() /var/www/myproject.local/app/console:0
PHP   2. Symfony\Component\Console\Application->run() /var/www/myproject.local/app/console:27
PHP   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
PHP   4. Symfony\Component\Console\Application->doRun() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
PHP   5. Symfony\Component\Console\Application->doRunCommand() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:195
PHP   6. Symfony\Component\Console\Command\Command->run() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:886
PHP   7. Heri\Bundle\JobQueueBundle\Command\QueueListenCommand->execute() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:259
PHP   8. Heri\Bundle\JobQueueBundle\Service\QueueService->listen() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Command/QueueListenCommand.php:69
PHP   9. Heri\Bundle\JobQueueBundle\Service\QueueService->loop() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Service/QueueService.php:243
PHP  10. Heri\Bundle\JobQueueBundle\Service\QueueService->attach() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Service/QueueService.php:273
PHP  11. ZendQueue\Queue->__construct() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Service/QueueService.php:102
PHP  12. ZendQueue\Queue->setAdapter() /var/www/myproject.local/vendor/zendframework/zend-queue/library/ZendQueue/Queue.php:127
PHP  13. ZendQueue\Queue->_setName() /var/www/myproject.local/vendor/zendframework/zend-queue/library/ZendQueue/Queue.php:222
PHP  14. Heri\Bundle\JobQueueBundle\Adapter\DoctrineAdapter->isExists() /var/www/myproject.local/vendor/zendframework/zend-queue/library/ZendQueue/Queue.php:493
PHP  15. Doctrine\ORM\EntityRepository->findOneBy() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Adapter/DoctrineAdapter.php:48
PHP  16. Doctrine\ORM\Persisters\BasicEntityPersister->load() /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:196
PHP  17. Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll() /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php:756
PHP  18. Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->hydrateAllData() /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:140
PHP  19. Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->hydrateRowData() /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php:48

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 80 bytes) in /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php on line 129

Call Stack:
    0.0002     241040   1. {main}() /var/www/myproject.local/app/console:0
    0.0180    3339712   2. Symfony\Component\Console\Application->run() /var/www/myproject.local/app/console:27
    0.0198    3552752   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
    0.1083   12072280   4. Symfony\Component\Console\Application->doRun() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
    0.1084   12073200   5. Symfony\Component\Console\Application->doRunCommand() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:195
    0.1127   12249200   6. Symfony\Component\Console\Command\Command->run() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:886
    0.1132   12255096   7. Heri\Bundle\JobQueueBundle\Command\QueueListenCommand->execute() /var/www/myproject.local/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:259
    0.1358   16124016   8. Heri\Bundle\JobQueueBundle\Service\QueueService->listen() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Command/QueueListenCommand.php:69
 1106.5008   33373472   9. Heri\Bundle\JobQueueBundle\Service\QueueService->loop() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Service/QueueService.php:243
 1106.5009   33373776  10. Heri\Bundle\JobQueueBundle\Service\QueueService->attach() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Service/QueueService.php:273
 1106.5009   33374224  11. ZendQueue\Queue->__construct() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Service/QueueService.php:102
 1106.5009   33375072  12. ZendQueue\Queue->setAdapter() /var/www/myproject.local/vendor/zendframework/zend-queue/library/ZendQueue/Queue.php:127
 1106.5010   33375072  13. ZendQueue\Queue->_setName() /var/www/myproject.local/vendor/zendframework/zend-queue/library/ZendQueue/Queue.php:222
 1106.5010   33375072  14. Heri\Bundle\JobQueueBundle\Adapter\DoctrineAdapter->isExists() /var/www/myproject.local/vendor/zendframework/zend-queue/library/ZendQueue/Queue.php:493
 1106.5010   33375376  15. Doctrine\ORM\EntityRepository->findOneBy() /var/www/myproject.local/vendor/heristop/jobqueue-bundle/Heri/Bundle/JobQueueBundle/Adapter/DoctrineAdapter.php:48
 1106.5010   33375752  16. Doctrine\ORM\Persisters\BasicEntityPersister->load() /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:196
 1106.5014   33379096  17. Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll() /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php:756
 1106.5014   33379096  18. Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->hydrateAllData() /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:140
 1106.5014   33380120  19. Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->hydrateRowData() /var/www/myproject.local/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php:48

And here are the relevant parts of the SF2 configuration file:

heri_job_queue:
    enabled:       true
#    max_messages:  1
    queues:        [ "jobs" ]

#Mono Log System
monolog:
    handlers:
        main:
            type:         fingers_crossed
            action_level: debug
            handler:      buffered
            buffer_size:  50
        nested:
            type:  stream
            path:  "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
        console:
            type:  console

Alfred

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.