naveenSquareShift opened a new issue, #13079:
URL: https://github.com/apache/apisix/issues/13079
### Current Behavior
The limit-count plugin with Redis policy shows the counter decrementing
instead of incrementing. While the rate limiting functionality works (returns
429 when limit exceeded), the counter value in Redis is incorrect.
### Expected Behavior
**Expected Behavior**
Counter should increment: 1, 2, 3, 4, 5, then return 429
**Actual Behavior**
Counter decrements: 5, 4, 3, 2, 1, 0, -1 (returns 429 but counter is wrong)
### Error Logs
**Test Output**
Request 1: HTTP 200 | Counter: 4
Request 2: HTTP 200 | Counter: 3
Request 3: HTTP 200 | Counter: 2
Request 4: HTTP 200 | Counter: 1
Request 5: HTTP 200 | Counter: 0
Request 6: HTTP 429 | Counter: -1
**Additional Notes**
- The rate limiting functionality works (HTTP 429 is returned correctly
when limit is exceeded)
- Only the counter visualization in Redis is incorrect
- This appears to be a display issue - the internal logic may be working
correctly
### Steps to Reproduce
1. Configure limit-count plugin with Redis policy:
"limit-count": {
"count": 5,
"time_window": 60,
"key": "consumer_name",
"key_type": "var",
"policy": "redis",
"redis_host": "redis",
"redis_port": 6379,
"redis_database": 0,
"rejected_code": 429
}
2. Configure key-auth plugin for authentication
3. Make authenticated requests to the route
4. Check Redis counter: GET plugin-limit-countroute1:{id}:alice
### Environment
**Environment**
- APISIX version: 3.9.0-debian (Docker image: apache/apisix:3.9.0-debian)
- OS: Debian
- Redis version: 7-alpine
- Deployment: Docker Compose
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]