Skip to content

Problem with symfony/rate-limiter #58690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ALZ-SteffenE opened this issue Oct 28, 2024 · 2 comments
Open

Problem with symfony/rate-limiter #58690

ALZ-SteffenE opened this issue Oct 28, 2024 · 2 comments

Comments

@ALZ-SteffenE
Copy link

Symfony version(s) affected

6.4.8

Description

We use the symfony/rate-limiter in a rest-api to make sure users can call an endpoint only every 300 Seconds (5minutes). We store the corresponding keys for the rate-limiter in REDIS.

This works perfectly fine until the time change from summer time to winter time.
Directly in the night after the time switch at 2 o'clock at night the Keys in REDIS seems not to work anymore. So the time change causes some weird behavior that results in the rate-limiter blocking more request as it should.

Please note: the switch from winter time to summer time did not cause this problem.

After deleting all REDIS keys manually everything directly worked fine again, without any code change.

How to reproduce

  • Configure the rate-limiter for an endpoint of an REST API with a 300 seconds limit.
  • Store the keys for that in REDIS.
  • Simulate the time change from summer time to winter time.
  • Try to call the REST endpoint in a time gap lower than 300 seconds and higher than 300 seconds
  • Monitor the behavior
  • Should result in http429 even if the gap is higher than 300 seconds
  • Delete the REDIS keys or restart redis to remove the keys
  • Everything will work fine again

Possible Solution

  • As a workaround removing the rate-limiter keys in REDIS solves the problem.

Additional Context

No response

@carsonbot
Copy link

Hey, thanks for your report!
There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?

@carsonbot
Copy link

Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@xabbuh @carsonbot @ALZ-SteffenE and others