Turning on auto_reconnect after starting an ApplicationRunner

#1

An application I’ve been working on has been having issues with losing its connection to crossbar, so I was looking into ways to reconnect after the connection drops.

I saw that ApplicationRunner.run has a keyword argument called auto_reconnect, but when I set it to True, I ran into a second issue: if the initial connection to crossbar failed due to incorrect login information being provided to the authenticator, the ApplicationRunner still treats it as a lost connection and repeatedly attempts to reconnect with the wrong login information, which leads to a number of other issues that I’d rather avoid.

Is there a way to wait until after a successful login to try to reconnect? I saw a comment on lines lines 333 and 334 of autobahn/twisted/wamp.py that, if I understood it correctly, describes some code that does exactly that, but it’s in an if statement that just says “if False” and will therefore never run.

0 Likes

#2

The scenario you described in paragraph 2 seems to be buggy behaviour to me. Have you filed a ticket?

···

On Thursday, August 3, 2017 at 3:09:42 PM UTC+2, Michael Plante wrote:

An application I’ve been working on has been having issues with losing its connection to crossbar, so I was looking into ways to reconnect after the connection drops.

I saw that ApplicationRunner.run has a keyword argument called auto_reconnect, but when I set it to True, I ran into a second issue: if the initial connection to crossbar failed due to incorrect login information being provided to the authenticator, the ApplicationRunner still treats it as a lost connection and repeatedly attempts to reconnect with the wrong login information, which leads to a number of other issues that I’d rather avoid.

Is there a way to wait until after a successful login to try to reconnect? I saw a comment on lines lines 333 and 334 of autobahn/twisted/wamp.py that, if I understood it correctly, describes some code that does exactly that, but it’s in an if statement that just says “if False” and will therefore never run.

0 Likes

#3

The scenario you described in paragraph 2 seems to be buggy behaviour to
me. Have you filed a ticket?

I'd say it is a missing feature;)

The feature being: auto-reconnect detecting that it never ever connected successfully in the first place, and hence not trying to reconnect at all, but bail out with "unreachable".

ABJS has that:

https://github.com/crossbario/autobahn-js/blob/master/lib/connection.js#L349

ABPy currently is less smart, and lacks that.

@Michael: If you care about this, pls file an issue ..

···

Am 10.08.2017 um 09:56 schrieb Adam Jorgensen:

On Thursday, August 3, 2017 at 3:09:42 PM UTC+2, Michael Plante wrote:

An application I've been working on has been having issues with losing its
connection to crossbar, so I was looking into ways to reconnect after the
connection drops.

I saw that ApplicationRunner.run has a keyword argument called
auto_reconnect, but when I set it to True, I ran into a second issue: if
the initial connection to crossbar failed due to incorrect login
information being provided to the authenticator, the ApplicationRunner
still treats it as a lost connection and repeatedly attempts to reconnect
with the wrong login information, which leads to a number of other issues
that I'd rather avoid.

Is there a way to wait until after a successful login to try to reconnect?
I saw a comment on lines lines 333 and 334
<https://github.com/crossbario/autobahn-python/blob/master/autobahn/twisted/wamp.py#L333> of
autobahn/twisted/wamp.py that, if I understood it correctly, describes some
code that does exactly that, but it's in an if statement that just says "if
False" and will therefore never run.

0 Likes

#4

Issue has been created.
https://github.com/crossbario/autobahn-python/issues/878

I’ve managed to work around this in the meantime by subclassing ApplicationRunner, but I’m not particularly thrilled with the way I did it.

···

On Thursday, August 10, 2017 at 4:07:37 AM UTC-4, Tobias Oberstein wrote:

Am 10.08.2017 um 09:56 schrieb Adam Jorgensen:

The scenario you described in paragraph 2 seems to be buggy behaviour to

me. Have you filed a ticket?

I’d say it is a missing feature;)

The feature being: auto-reconnect detecting that it never ever connected
successfully in the first place, and hence not trying to reconnect at
all, but bail out with “unreachable”.

ABJS has that:

https://github.com/crossbario/autobahn-js/blob/master/lib/connection.js#L349

ABPy currently is less smart, and lacks that.

@Michael: If you care about this, pls file an issue …

On Thursday, August 3, 2017 at 3:09:42 PM UTC+2, Michael Plante wrote:

An application I’ve been working on has been having issues with losing its

connection to crossbar, so I was looking into ways to reconnect after the

connection drops.

I saw that ApplicationRunner.run has a keyword argument called

auto_reconnect, but when I set it to True, I ran into a second issue: if

the initial connection to crossbar failed due to incorrect login

information being provided to the authenticator, the ApplicationRunner

still treats it as a lost connection and repeatedly attempts to reconnect

with the wrong login information, which leads to a number of other issues

that I’d rather avoid.

Is there a way to wait until after a successful login to try to reconnect?

I saw a comment on lines lines 333 and 334

<https://github.com/crossbario/autobahn-python/blob/master/autobahn/twisted/wamp.py#L333> of

autobahn/twisted/wamp.py that, if I understood it correctly, describes some

code that does exactly that, but it’s in an if statement that just says "if

False" and will therefore never run.

0 Likes