You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Harden the drain guard against cycling pagination cursors
Comparing only against the immediately preceding cursor catches a server
that echoes the cursor back but not one that alternates between cursors
(a, b, a, ...), which would still page forever. Track every cursor seen
during the drain and raise on any repeat, in both the Client drains and
the ClientSessionGroup aggregation drain.
Copy file name to clipboardExpand all lines: docs/advanced/pagination.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,10 +65,11 @@ That loop is the same one in every client that pages, so `Client` ships it. The
65
65
`ClientSessionGroup` aggregation drains the same way, so a group fronting several servers reports the full collection instead of each server's first page. That aggregator is **[Session groups](../client/session-groups.md)**.
66
66
67
67
!!! warning
68
-
A drain trusts the server to advance the cursor. A server that keeps returning the same
69
-
`next_cursor` it was handed would page forever, so the drains stop and raise `RuntimeError`
70
-
the moment a cursor fails to move. A page that does not advance is a broken server, and a
71
-
loud failure beats a silent hang or a half-read list.
68
+
A drain trusts the server to advance the cursor. A server that echoes back the
69
+
`next_cursor` it was handed, or cycles through a longer loop of them, would page forever,
70
+
so the drains remember every cursor they have seen and raise `RuntimeError` the moment one
71
+
repeats. A repeated cursor is a broken server, and a loud failure beats a silent hang or a
0 commit comments