You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My team and I noticed the following alarming behavior of autobahn’s retry policy when an invalid/bogus URL is given for the _connect function in the init.py file:
• Instead of implementing the default retry policy of trying to reconnect in 1, 2, 4, 8, 16, etc seconds, the _connect function is instead spamming the server with retry requests multiple times per second!
• This is due to the fact that the _reconnect function does not have a delay or retry policy
o If the retry fails, _reconnect calls the _connect function immediately, which then calls _reconnect right away when that fails, and so on.
• This leads to a system spamming our corporate network with a flood of connection requests, which causes the network to prevent any other systems from connecting. This is very troublesome as it practically prevents any of our systems from connecting to the network!
• The python version we are using is 3.6.2
We are trying to understand why the invalid URL case does not get handled as a retry (except OSError) but rather that the reconnect happens instantaneously. The affected source code is shown below
@asyncio.coroutine
def _connect(self):
self._active_protocol = None
self._retry_strategy.reset_retry_interval()
while True:
try:
_, protocol = yield from self._loop.create_connection(self._transport_factory, self._host, self._port, ssl=self._ssl)
protocol.is_closed.add_done_callback(self._reconnect)
self._active_protocol = protocol
return
except OSError:
print('Connection failed')
if self._retry_strategy.retry():
retry_interval = self._retry_strategy.get_retry_interval()
print('Retry in {} seconds'.format(retry_interval))
yield from asyncio.sleep(retry_interval)
else:
print('Exceeded retry count')
self._loop.stop()
raise ExceededRetryCount()
self._retry_strategy.increase_retry_interval()
def _reconnect(self, f):
# Reconnect
print('Connection lost')
if not self._closing:
print('Reconnecting')
asyncio.async(self._connect(), loop=self._loop)
The text was updated successfully, but these errors were encountered:
richardmu92129
changed the title
Error handling in the autobahn_autoreconnect file
Bad error handling in the autobahn_autoreconnect file
Apr 17, 2023
My team and I noticed the following alarming behavior of autobahn’s retry policy when an invalid/bogus URL is given for the _connect function in the init.py file:
• Instead of implementing the default retry policy of trying to reconnect in 1, 2, 4, 8, 16, etc seconds, the _connect function is instead spamming the server with retry requests multiple times per second!
• This is due to the fact that the _reconnect function does not have a delay or retry policy
o If the retry fails, _reconnect calls the _connect function immediately, which then calls _reconnect right away when that fails, and so on.
• This leads to a system spamming our corporate network with a flood of connection requests, which causes the network to prevent any other systems from connecting. This is very troublesome as it practically prevents any of our systems from connecting to the network!
• The python version we are using is 3.6.2
We are trying to understand why the invalid URL case does not get handled as a retry (except OSError) but rather that the reconnect happens instantaneously. The affected source code is shown below
@asyncio.coroutine
def _connect(self):
self._active_protocol = None
self._retry_strategy.reset_retry_interval()
while True:
try:
_, protocol = yield from self._loop.create_connection(self._transport_factory, self._host, self._port, ssl=self._ssl)
protocol.is_closed.add_done_callback(self._reconnect)
self._active_protocol = protocol
return
except OSError:
print('Connection failed')
if self._retry_strategy.retry():
retry_interval = self._retry_strategy.get_retry_interval()
print('Retry in {} seconds'.format(retry_interval))
yield from asyncio.sleep(retry_interval)
else:
print('Exceeded retry count')
self._loop.stop()
raise ExceededRetryCount()
The text was updated successfully, but these errors were encountered: