Giter Site home page Giter Site logo

Comments (10)

alanxz avatar alanxz commented on July 28, 2024

Did you happen to catch where the memory is piling up?

I'm going to guess its the channel.close method frames hanging around and that some cleanup is needed when a channel closes

from simpleamqpclient.

noldus avatar noldus commented on July 28, 2024

I did go as far as the AmqpClient::Detail::Channel::BasicPublish method, but I can take it a step further if this helps you.

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

I've pushed what I think is a fix for your issue in the issue28_exception_frame_free branch. (see #29). You want to give that a shot see if it fixes your issue, I'd appreciate the feedback.

from simpleamqpclient.

noldus avatar noldus commented on July 28, 2024

Thanks for the quick response. I tried your patch and indeed it fixes the issue. I don't know if this is your final solution, but I would like to propose a small improvement. The fix now throws an exception which doesn't have a meaning when I catch it. In the previous situation I could catch the exception which corresponded to a non-existing exchange. Is it possible to rethrow the original exception? Like I did below?

try
{
AmqpException::Throw(*reinterpret_cast<amqp_channel_close_t*>(incoming_frame.payload.method.decoded));
}
catch (AmqpException& e)
{
MaybeReleaseBuffers();
throw e;   <<<<<<<< Is it possible to rethrow the original exception?
}

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

Believe it or not my code does do the right thing. When you throw inside a catch statement without an argument it rethrows the original exception.

Your code will cause the exception to be copied using the copy constructor that copies exception is then thrown.

See this: http://stackoverflow.com/questions/2360597/c-exceptions-questions-on-rethrow-of-original-exception

from simpleamqpclient.

noldus avatar noldus commented on July 28, 2024

Yes, you're right. I didn't know that, so I learned something here.

I was shuffeling around with the libraries to see the difference in behaviour and by accident loaded the old version. I guess something went wrong here.

When do you think you can push the fix to the trunk?

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

The patch seems to have minimal impact. I'll probably merge it later this evening when I have a moment.

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

Merged.

from simpleamqpclient.

noldus avatar noldus commented on July 28, 2024

Thank you very much!

from simpleamqpclient.

chenyujian avatar chenyujian commented on July 28, 2024

i just met this problem,thank you for reporting and quickly solving this bug,

from simpleamqpclient.

Related Issues (20)

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.