Skip to content

Commit 35ff076

Browse files
authored
Merge pull request #7747 from kozlovsky/fix/event_manager_reconnect
Add one single attempt to reconnect to the Core in case of EventReqestManager disconnection
2 parents aac0331 + 3827f62 commit 35ff076

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/tribler/gui/event_request_manager.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ def on_error(self, error: int, reschedule_on_err: bool):
130130
return
131131

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

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

0 commit comments

Comments
 (0)