Skip to content

Comments

Fix quota result when all limits were exceeded#1059

Open
yanavlasov wants to merge 4 commits intoenvoyproxy:mainfrom
yanavlasov:fix-quota-mode
Open

Fix quota result when all limits were exceeded#1059
yanavlasov wants to merge 4 commits intoenvoyproxy:mainfrom
yanavlasov:fix-quota-mode

Conversation

@yanavlasov
Copy link

@yanavlasov yanavlasov commented Feb 5, 2026

Fix results in quota mode when all limits have been exceeded. In this case request should be denied.

Also add starter integration tests for quota mode.

Signed-off-by: yavlasov <yavlasov@google.com>
@yanavlasov
Copy link
Author

@yuzisun for initial review

@yanavlasov yanavlasov marked this pull request as draft February 5, 2026 23:55
@yanavlasov
Copy link
Author

Need to rework the mixed mode. Will ping when it is ready for review.

exit 1
fi

echo "Wating 1 minute for quota buckets to be refreshed"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
echo "Wating 1 minute for quota buckets to be refreshed"
echo "Waiting 1 minute for quota buckets to be refreshed"

Copy link
Author

Choose a reason for hiding this comment

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

Done


response=$(curl -i -s http://envoy-proxy:8888/quota)
if [ $? -ne 0 ]; then
echo "Quota bucket should be refereshed"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
echo "Quota bucket should be refereshed"
echo "Quota bucket should be refreshed"

Copy link
Author

Choose a reason for hiding this comment

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

Done

response.Statuses = make([]*pb.RateLimitResponse_DescriptorStatus, len(request.Descriptors))
finalCode := pb.RateLimitResponse_OK
if isQuotaMode {
finalCode = pb.RateLimitResponse_OVER_LIMIT
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this behavior be configurable and default to reject ? we may still want to send out and let cloud provider reject as the quota tracking in envoy is best effort and the quota enforcement window may not be exactly aligned with the cloud provider.

Copy link
Author

Choose a reason for hiding this comment

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

This looks like what shadow mode is doing, unless I misunderstand it.

Signed-off-by: yavlasov <yavlasov@google.com>
Signed-off-by: yavlasov <yavlasov@google.com>
@yanavlasov yanavlasov marked this pull request as ready for review February 9, 2026 20:21
Signed-off-by: yavlasov <yavlasov@google.com>
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.

2 participants