-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Infinite loop in rate limit middleware #2687
Labels
Comments
jlucktay
added a commit
that referenced
this issue
Nov 28, 2019
- increases test coverage across issue described in #2687 - covers more throttle interval values as identified during investigation of original issue
buger
pushed a commit
that referenced
this issue
Dec 27, 2019
- increases test coverage across issue described in #2687 - covers more throttle interval values as identified during investigation of original issue
buger
pushed a commit
that referenced
this issue
Dec 27, 2019
Fix #2687 Move guard statement forward to prevent infinite recursive loop. Test coverage is forthcoming.
furkansenharputlu
pushed a commit
that referenced
this issue
Dec 30, 2019
Fix #2687 Move guard statement forward to prevent infinite recursive loop. Test coverage is forthcoming.
furkansenharputlu
pushed a commit
that referenced
this issue
Dec 30, 2019
Fix #2687 Move guard statement forward to prevent infinite recursive loop. Test coverage is forthcoming.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Branch/Environment/Version
v2.8.5
Describe the bug
In certain circumstances, requests passing through the rate limit/quota check middleware may fall into an infinite loop, due to a recursive function call that is not properly guarded and as such does not have an adequate exit condition.
Reproduction steps
TBD
Actual behavior
Some requests entering the gateway get stuck on an infinite/recursive loop, never get past the rate limit/quota check middleware, and cause a gradual increase in CPU usage and allocated memory.
Expected behavior
All requests entering the gateway are limit-/quota-checked and throttled/retried/completed appropriately.
Screenshots/Video
pprof
output from theinuse_space
sample of twoheap
profiles of an affected gateway are below.Profile 1 is still receiving new traffic and Profile 2 is after the point where new traffic is no longer entering the gateway.
Corresponding increases in CPU time spent were also identified on the CPU profile in
pprof
(not shown).CPU usage of the instance running this affected gateway, in contrast to some other healthy instances/gateways:
Configuration (tyk config file):
TBD
The text was updated successfully, but these errors were encountered: