mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
network.new_interface: clarify how timed out interfaces are closed
This commit is contained in:
parent
64ab8222f7
commit
e4bd445a38
2 changed files with 7 additions and 2 deletions
|
@ -264,8 +264,7 @@ class Interface(PrintError):
|
|||
|
||||
def mark_ready(self):
|
||||
if self.ready.cancelled():
|
||||
self.close()
|
||||
raise asyncio.CancelledError()
|
||||
raise GracefulDisconnect('conn establishment was too slow; *ready* future was cancelled')
|
||||
if self.ready.done():
|
||||
return
|
||||
|
||||
|
|
|
@ -630,6 +630,12 @@ class Network(PrintError):
|
|||
#import traceback
|
||||
#traceback.print_exc()
|
||||
self.print_error(interface.server, "couldn't launch because", str(e), str(type(e)))
|
||||
# note: connection_down will not call interface.close() as
|
||||
# interface is not yet in self.interfaces. OTOH, calling
|
||||
# interface.close() here will sometimes raise deep inside the
|
||||
# asyncio internal select.select... instead, interface will close
|
||||
# itself when it detects the cancellation of interface.ready;
|
||||
# however this might take several seconds...
|
||||
self.connection_down(interface.server)
|
||||
return
|
||||
finally:
|
||||
|
|
Loading…
Add table
Reference in a new issue