-
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
[TT-13041] Adjust quota handling of missing or expired keys #6492
Conversation
API Changes --- prev.txt 2024-09-10 20:24:17.276297472 +0000
+++ current.txt 2024-09-10 20:24:14.224295263 +0000
@@ -11926,6 +11926,9 @@
func Cert(domain string) tls.Certificate
Generate cert
+func Exclusive(t *testing.T)
+ Exclusive uses a lock to gate only a single test running.
+
func Flaky(t *testing.T, fake ...func() (bool, func(...interface{})))
Flaky skips a flaky test in a CI environment
|
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
f4b5cef
to
3fc577f
Compare
4a1caec
to
1a78c3f
Compare
Quality Gate failedFailed conditions |
/release to release-5.3 |
Working on it! Note that it can take a few minutes. |
@titpetric Seems like there is conflict and it require manual merge. |
Bug fix, Enhancement ___ - Refactored the `RedisQuotaExceeded` function to improve quota handling logic, including better management of key expiration and renewal. - Enhanced logging with additional context to aid in debugging and monitoring of quota operations. - Removed the distributed lock during quota increment and added it during quota reset to optimize performance. - Updated test cases in `middleware_test.go` to use `t.Run` for better organization and added additional test cases for comprehensive coverage. ___ <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>middleware_test.go</strong><dd><code>Refactor and extend test cases for session limiter</code> </dd></summary> <hr> gateway/middleware_test.go <li>Refactored test cases to use <code>t.Run</code> for better organization.<br> <li> Added additional test cases for API3 to check quota decrement.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6492/files#diff-6a09a08e3f82cc5e9d8c6b5c8426d75ea1e5d85e15ab008fca1f512e7c49c1e6">+18/-12</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>session_manager.go</strong><dd><code>Refactor quota handling logic and improve logging</code> </dd></summary> <hr> gateway/session_manager.go <li>Improved logging for quota management with additional context.<br> <li> Refactored quota increment logic to handle key expiration and renewal.<br> <li> Removed distributed lock for quota increment and added it for quota <br>reset.<br> <li> Ensured session quota is updated with new logic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6492/files#diff-e6b40a285464cd86736e970c4c0b320b44c75b18b363d38c200e9a9d36cdabb6">+84/-51</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Tit Petric <tit@tyk.io>
PR Type
Bug fix, Enhancement
https://tyktech.atlassian.net/browse/TT-13041
Description
RedisQuotaExceeded
function to improve quota handling logic, including better management of key expiration and renewal.middleware_test.go
to uset.Run
for better organization and added additional test cases for comprehensive coverage.Changes walkthrough 📝
middleware_test.go
Refactor and extend test cases for session limiter
gateway/middleware_test.go
t.Run
for better organization.session_manager.go
Refactor quota handling logic and improve logging
gateway/session_manager.go
reset.