Skip to content

Commit 5602af3

Browse files
committed
Add SMIGRATING id to list ocontaining _processed_start_maint_notifications
1 parent 4db06f6 commit 5602af3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

redis/asyncio/maint_notifications.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
MaintNotificationsConfig,
1515
NodeMovingNotification,
1616
OSSNodeMigratedNotification,
17+
OSSNodeMigratingNotification,
1718
_get_maintenance_notification_name,
1819
_get_maintenance_notification_type,
1920
_should_skip_connection_timeout_update,
@@ -331,6 +332,11 @@ async def handle_maintenance_start_notification(
331332
tmp_relaxed_timeout=self.config.relaxed_timeout
332333
)
333334
self.connection.update_current_socket_timeout(self.config.relaxed_timeout)
335+
if isinstance(notification, OSSNodeMigratingNotification):
336+
# add the notification id to the set of processed start maint notifications
337+
# this is used to skip the unrelaxing of the timeouts if we have received more than
338+
# one start notification before the the final end notification
339+
self.connection.add_maint_start_notification(notification.id)
334340

335341
maint_notification = _get_maintenance_notification_name(notification)
336342
await record_connection_relaxed_timeout(

0 commit comments

Comments
 (0)