Skip to content

[fix] bound what one anonymous push request can consume - #4273

Open
Duansg wants to merge 1 commit into
apache:masterfrom
Duansg:fix-push-gateway-hardening
Open

[fix] bound what one anonymous push request can consume#4273
Duansg wants to merge 1 commit into
apache:masterfrom
Duansg:fix-push-gateway-hardening

Conversation

@Duansg

@Duansg Duansg commented Jul 29, 2026

Copy link
Copy Markdown
Member

What's changed?

Add three configurable caps to the push gateway: auto-created monitors, request body size, and sample count.

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

@zqr10159

Copy link
Copy Markdown
Member

There is still a concurrency hole in the auto-created-monitor cap. containsKey/size is checked before computeIfAbsent; multiple new job/instance keys can all observe capacity and then insert, exceeding the configured maximum. The current tests exercise sequential calls only. Please make reservation atomic (for example with a semaphore/explicit reservation or a truly bounded cache) and add a concurrent burst test that proves the map never exceeds the cap. The request-body and sample-count limits are still useful independently.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants