Skip to content

Commit 9956a48

Browse files
committed
fix: ensure results are returned when failover times out
1 parent e3e5762 commit 9956a48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws_advanced_python_wrapper/reader_failover_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ def failover(self, current_topology: Tuple[HostInfo, ...], current_host: Optiona
107107

108108
try:
109109
result = future.result(timeout=self._max_failover_timeout_sec)
110-
if result is None:
111-
result = ReaderFailoverHandlerImpl.failed_reader_failover_result
112110
except TimeoutError:
113111
self._timeout_event.set()
114112
finally:
113+
if result is None:
114+
result = ReaderFailoverHandlerImpl.failed_reader_failover_result
115115
executor.shutdown(wait=False)
116116

117117
return result

0 commit comments

Comments
 (0)