debug
This commit is contained in:
parent
8098438882
commit
b75077c1e4
2 changed files with 7 additions and 1 deletions
|
@ -90,6 +90,7 @@ class ClientSession(BaseClientSession):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
if self.is_closing():
|
if self.is_closing():
|
||||||
|
log.warning("is closing, reconnect")
|
||||||
await self.create_connection(self.timeout)
|
await self.create_connection(self.timeout)
|
||||||
await self.ensure_server_version()
|
await self.ensure_server_version()
|
||||||
self._on_connect_cb()
|
self._on_connect_cb()
|
||||||
|
@ -99,10 +100,14 @@ class ClientSession(BaseClientSession):
|
||||||
except RPCError as e:
|
except RPCError as e:
|
||||||
log.warning("Server error, ignoring for 1h: %s:%d -- %s", *self.server, e.message)
|
log.warning("Server error, ignoring for 1h: %s:%d -- %s", *self.server, e.message)
|
||||||
retry_delay = 60 * 60
|
retry_delay = 60 * 60
|
||||||
except (asyncio.TimeoutError, OSError):
|
except asyncio.TimeoutError:
|
||||||
|
log.error("closing due to timeout")
|
||||||
await self.close()
|
await self.close()
|
||||||
retry_delay = min(60, retry_delay * 2)
|
retry_delay = min(60, retry_delay * 2)
|
||||||
log.warning("Wallet server timeout (retry in %s seconds): %s:%d", retry_delay, *self.server)
|
log.warning("Wallet server timeout (retry in %s seconds): %s:%d", retry_delay, *self.server)
|
||||||
|
except Exception:
|
||||||
|
log.exception("unexpected error")
|
||||||
|
raise
|
||||||
try:
|
try:
|
||||||
await asyncio.wait_for(self.trigger_urgent_reconnect.wait(), timeout=retry_delay)
|
await asyncio.wait_for(self.trigger_urgent_reconnect.wait(), timeout=retry_delay)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
|
|
|
@ -115,6 +115,7 @@ class SessionBase(asyncio.Protocol):
|
||||||
try:
|
try:
|
||||||
await asyncio.wait_for(self._can_send.wait(), secs)
|
await asyncio.wait_for(self._can_send.wait(), secs)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
|
self.logger.warning("abort connection after limited wait (%s)", secs)
|
||||||
self.abort()
|
self.abort()
|
||||||
raise asyncio.TimeoutError(f'task timed out after {secs}s')
|
raise asyncio.TimeoutError(f'task timed out after {secs}s')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue