Skip to content

Commit

Permalink
Merge pull request #7747 from kozlovsky/fix/event_manager_reconnect
Browse files Browse the repository at this point in the history
Add one single attempt to reconnect to the Core in case of EventReqestManager disconnection
  • Loading branch information
kozlovsky committed Dec 4, 2023
2 parents aac0331 + 3827f62 commit 35ff076
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/tribler/gui/event_request_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,12 @@ def on_error(self, error: int, reschedule_on_err: bool):
return

if self.receiving_data:
# Most probably Core is crashed. If CoreManager decides to restart the core,
# it will also call event_manager.connect_to_core()
self._logger.error('The connection to the Tribler Core was lost')
# Most probably Core crashed, but we try to reconnect anyway one single time to be sure.
# Later, if Core crashed and CoreManager decides to restart the core, it will also call
# event_manager.connect_to_core(reschedule_on_err=True)
self.receiving_data = False
self._logger.error('The connection to the Tribler Core was lost, trying to reconnect one single time')
self.reconnect(reschedule_on_err=False)
return

should_retry = reschedule_on_err and time.time() < self.start_time + CORE_CONNECTION_TIMEOUT
Expand Down

0 comments on commit 35ff076

Please sign in to comment.