Code Monkey home page Code Monkey logo

lswguzzlebundle's Issues

Memory leak

I have been investigating why our system workers are dying after a given amount of jobs are processed.

I was able to track the memory leak to this bundle.
Using the guzzle library itself does fix the issue, so it is definitely in the bundle itself.

I have even tried the case with more than 10,000 objects created, as this seem to be the limit after which the garbage collector becomes active, but the issue persists. Reference: https://bugs.php.net/bug.php?id=68132

My use case is as follows:

class SomeClass()
{
    public function someMethod()
    {
        /* @var $response Guzzle\Service\Command\CommandInterface */
        $command = $this->client->getCommand('get_item_by_id', $params);

        /* @var $response Guzzle\Http\Message\Response */
        $response = $command->getResponse();

        return $this->transformResponse($response->getBody(true));
    }

    protected function transformResponce($response)
    {
        /** some code that transforms json to an object */
    }

Replacing some parts of the code by avoiding the bundle seems to fix the case for me:

    $client = new \Guzzle\Http\Client('https://baseurl.com/api');
    $request = $client->get('url.php?id=' . $id);
    $response = $request->send();

[Bug] Fatal error -> getInfo()

Nice bundle but is it working? In my first attempt of using it I get fatal:

Error: Call to a member function getInfo() on a non-object in (...)vendor/leaseweb/guzzle-bundle/Lsw/GuzzleBundle/DataCollector/GuzzleDataCollector.php line 50

Fresh install does not work because of old version of guzzle

Hello,

I have tried to install the bundle, but there seem to be multiple problems..

I have installed the bundle like so:
composer require "leaseweb/guzzle-bundle" "*"

I have initiated an update just to be on the safe side:
composer update "leaseweb/guzzle-bundle"

I have set the configuration as shown in the readme, but the following errors appear:

PHP Notice:  Undefined index: base_url in /projects/feed-engine/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php on line 75
PHP Warning:  call_user_func() expects parameter 1 to be a valid callback, class 'Guzzle\Service\Description\ServiceDescription' does not have a method 'factory' in /projects/feed-engine/app/cache/dev/appDevDebugProjectContainer.php on line 1398
PHP Catchable fatal error:  Argument 1 passed to Guzzle\Service\Client::setDescription() must be an instance of Guzzle\Service\Description\ServiceDescription, null given, called in /projects/feed-engine/app/cache/dev/appDevDebugProjectContainer.php on line 1317 and defined in /projects/feed-engine/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php on line 358

I am using the master branch, as indicated on the top, but I have also tried to use some of the presumably stable branches - v1.0.2, and the very same error message is shown.

Inside composer.json you are not indicating a strict version of guzzle to be used.
I think this is the problem. Isn't guzzle 1.0.4 very old?

vagrant@ubuntu-14:/projects/feed-engine$ composer require "leaseweb/guzzle-bundle" "*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing guzzle/guzzle (v1.0.4)
    Loading from cache

  - Installing leaseweb/guzzle-bundle (v1.0.2)
    Loading from cache

P.S Yes, three years old to be exact. https://github.com/guzzle/guzzle/tree/v1.0.4

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.