Fixed potential EPOLL hang on interface failure

This commit is contained in:
Mark Qvist 2025-07-13 19:16:51 +02:00
parent c0d7f42f17
commit fad1d4972c
2 changed files with 11 additions and 5 deletions

View file

@ -254,6 +254,9 @@ class LocalClientInterface(Interface):
if self.is_connected_to_shared_instance and not self.detached:
RNS.log("Socket for "+str(self)+" was closed, attempting to reconnect...", RNS.LOG_WARNING)
RNS.Transport.shared_connection_disappeared()
# TODO: Potentially run this in a thread, but since if we get here,
# there's no other connectivity left to block anyway, it might be
# unnecessary.
self.reconnect()
else:
self.teardown(nowarning=True)
@ -276,6 +279,9 @@ class LocalClientInterface(Interface):
if self.is_connected_to_shared_instance and not self.detached:
RNS.log("Socket for "+str(self)+" was closed, attempting to reconnect...", RNS.LOG_WARNING)
RNS.Transport.shared_connection_disappeared()
# TODO: Potentially run this in a thread, but since if we get here,
# there's no other connectivity left to block anyway, it might be
# unnecessary.
self.reconnect()
else:
self.teardown(nowarning=True)