Re: Managing the lifetime of a proton::delivery object

2019-04-30 Thread Cliff Jansen
Hi Rabih, Thank you for the concise test case. I believe the problem is that you are using proton::delivery::work_queue() from the exterior thread, and that call is not thread safe. If you look at the multithreaded client examples, you will see that the work_queue is acquired and saved into

Re: Managing the lifetime of a proton::delivery object

2019-04-30 Thread Rabih M
Hello Cliff, After spending more time debugging, I think we found where the real problem comes from: I attached a simplified use case in the Main.cpp, Broker.hpp. When we call delivery.work_queue().add() line 35 of Main.cpp, we get an random segfault and if we replace it instead by a connection.wo

Re: Managing the lifetime of a proton::delivery object

2019-04-26 Thread Cliff Jansen
Hi Jeremy, I haven't had a chance to parse your overall description to arrive at a reproducer of your segfault problem. However, the DeliverySettleTest.cpp code you provided runs correctly. The client view of the delivery is settled via d.accept(); // line 34 which results in the disposition

Managing the lifetime of a proton::delivery object

2019-04-25 Thread jeremy
Hello, In the client API we're writing, we let a consumer consume messages asynchronously, receiving a future of a delivery. In the receiver handler, we keep track of deliveries in a list, as such: https://github.com/rabih-mourad/qpid-imperative-proton/blob/master/include/proton/imperative/Receive