On 01/04/2019 22:28, Gordon Sim wrote:
On 29/03/2019 12:26 pm, Toralf Lund wrote:
Another one related to issues I've mentioned in other recent posts:

I'm doing some debugging related to undesired side effects in one of our applications after it gets a "Failed to connect (reconnect disabled)" error while sending to or receiving from the C++ broker. In then "manually" reopens the connection after a slight delay. As parts of the reconnect logic, I also tend to get "'session-busy: Session detached by peer'". This is possibly triggered by the connect itself, but it could also come from other operations done just after connecting.

This would be a whole lot easier if I could provoke the errors into occurring, so as to speak. I guess the "failed to connect" error means the broker has dropped the connection, but is there a way I can force it to do that (without restarting)? And how about the "Session detached by peer"? It's not clear to me when exactly I get that, but I guess it's related to sessions that existed before the connection was closed. Which (according to information I got here earlier) Connection::open() might try to recreate, but perhaps the operation fails? Can I somehow manipulate the state so I can find out more about the behaviour?

You can specify the name for the session when you create it. So one approach might be to connect your client (the one you want to test), then kill -STOP that client, then start a test client that just opens a session with the same name (e.g. see attached), then kill -CONT the client which should then failover (assuming heartbeats were on) and hit the session-busy error.

Thanks. That helps quite I bit. The errors I get with this experiment are consistent with what I'm seeing on the real installation - which I guess suggests the "Session detached by peer" occurs because the session already exists and is attached to another active connection (as seen from the broker.) In the test case, it's quite definitely Connection::open() itself that raises the exception. Furthermore, it looks like it's quite all right to use the connection anyway, but the session has to be set up again from scratch.

- Toralf

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to