Re: Question about SimpleAmqpClient on network error and recover from this

145 views
Skip to first unread message

Alan Antonuk

unread,
Nov 11, 2016, 2:17:42 AM11/11/16
to Walt Kemme, Bas Schoorl, simpleamqpclient-users
Which exception is thrown?  Can you give a pared down example that demonstrates the issue?

-Alan

On Thu, Nov 10, 2016 at 6:40 AM Walt Kemme <walt....@boonedam.com> wrote:

Hi Alan,


We, at Boon Edam are working on a rabbit MQ implementation using the c++ interface SimpleAmqpClient. Since you are working on this source code, maybe you can help us out with a issue when the network is broken for a while.


Communication with rabbitMQ works fine till the server is rebooted or when the network is broken for several minutes. When we try to call the createSecure(...) method after the connection was broken for a second time, we got a runtime error and the program terminates. Is there any way to prevent this error and make a new valid connection? When the interface supports a method where we can close or remove the old invalid connection, we would be able to reconnect without a program termination. Hope you can help us out.


using

- ubuntu 14.04

- SimpleAmqpClient master (2.5.0) and also with 2.4.0 release version.

- rabbitmq-c 0.8.0 (4.2.1)


Thanx, Walt


Alan Antonuk

unread,
Nov 15, 2016, 1:12:04 AM11/15/16
to Walt Kemme, Bas Schoorl, simpleamqpclient-users
I don't see anything obviously wrong with the example code.  What exception is thrown. In particular what's in the what() string for the exception?

-Alan

On Fri, Nov 11, 2016 at 5:01 AM Walt Kemme <walt....@boonedam.com> wrote:

Hi Alan,


I have made an example program in C++/Qt.


It makes a SecureConnection twice. These go all right. Then there is a small pause of 120 seconds to be able to shutdown the server where the connection was made to.

After the shutdown and restart within the 2 minutes, the application will try to make a new secure connection. It will terminate.


The certificates and server connection settings are not included in the example. But I expect you will have them yourself.


Thanx for looking at the issue,

Regards, Walt


Van: Alan Antonuk <alan.a...@gmail.com>
Verzonden: vrijdag 11 november 2016 08:17:30
Aan: Walt Kemme
CC: Bas Schoorl; simpleamqpclient-users
Onderwerp: Re: Question about SimpleAmqpClient on network error and recover from this
 

Alan Antonuk

unread,
Nov 19, 2016, 5:43:38 PM11/19/16
to Walt Kemme, Bas Schoorl, simpleamqpclient-users
Each call to CreateSecure() creates an entirely new connection object and associated data-structures. Neither SimpleAmqpClient, nor rabbitmq-c has global state that is modified during connection creation. There is a one-time setup of OpenSSL that rabbitmq-c does the first time that a program opens an SSL connection. 

I cannot reproduce the behavior you're observing. Can you determine what is causing the program to exit? (segfault? some other signal?).  It'd also be helpful if you could produce a stack-trace at the point that causes the program to exit.

-Alan

On Wed, Nov 16, 2016 at 2:06 AM Walt Kemme <walt....@boonedam.com> wrote:

Hi Alan,

 

The example code is not the code that is wrong, but the library SimpleAmqpClient. The test just exit the application without having an exception. 

 

This is the output of the test code for trying to connect again:

….

“35 seconds passed”

“40 seconds passed”

“45 seconds passed”

“50 seconds passed”

“55 seconds passed”

Calling CreateSecure()…

The program has unexpectedly finished.

 

Is seems, some internal pointer is invalid and does something really wrong when the connection became broken and a new one is tried to create. No exception is thrown. 

 

Hope you can dig into this issue.

Thanks,

Reply all
Reply to author
Forward
0 new messages