Skip to content

Conversation

@kiokuless
Copy link

@kiokuless kiokuless commented Mar 14, 2024

Proposed changes

I noticed that the e.rateLimiter set in WithGlobalRateLimit was overwritten in sdk_private.go and the RPS was unlimited every time, so I fixed it.

I ran WithGlobalRateLimit(10, time.Second) in examples/simple/simple.go to verify that the RPS is correctly below 10.

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

lgtm - It doesn't seem the case if the ratelimit is correctly scoped and closed, but I think this might create gc glitches with internal ephemeral objects as in #4836

@Mzack9999 Mzack9999 requested a review from ehsandeep March 15, 2024 00:18
@ehsandeep ehsandeep merged commit aaf3cf9 into projectdiscovery:dev Mar 15, 2024
@kiokuless kiokuless deleted the fix-rate-limiter branch March 15, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants