Skip to content

Re-introduce access list read rate limiting#62670

Merged
tigrato merged 1 commit intomasterfrom
tigrato/reinstatereadlimit
Jan 7, 2026
Merged

Re-introduce access list read rate limiting#62670
tigrato merged 1 commit intomasterfrom
tigrato/reinstatereadlimit

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented Jan 7, 2026

This PR re-introduces access list read rate limiting removed in #62649. The PR had merge enabled and was merged without addressing the feedback.

This PR re-introduces access list read rate limiting removed in #62649.
The PR had merge enabled and was merged without addressing the feedback.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
err = clientutils.IterateResources(ctx, a.Cache.ListAccessLists, func(al *accesslist.AccessList) error {
if !al.IsReviewable() {
return nil
var accessListsPageKey string
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about keeping IterateResources and just putting a time.Sleep at the end of the closure? It's only 5ms, so if the context is canceled it won't take us long to detect.

I'm just weary of continuing to hand-write pagination code given the dozens of pagination bugs we've had. Now that we've got a well-tested and uniform tool, I think we should use it wherever possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I removed it in the first place is that if the sleep is inside the closure, it will sleep 20× more than intended. That’s because the IterateResources closure is invoked per item, not per page.

I could technically sleep for 1/20 of the time, but I think it’s better to keep the code as it is.

I could also add another iterator that operates on pages instead, but that would likely make the code more confusing.

@tigrato tigrato added this pull request to the merge queue Jan 7, 2026
Merged via the queue into master with commit 75db250 Jan 7, 2026
45 checks passed
@tigrato tigrato deleted the tigrato/reinstatereadlimit branch January 7, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants