-
Notifications
You must be signed in to change notification settings - Fork 522
feat(zerozone2): add overload protection #3002
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds overload protection mechanisms to the zerozone2 system to handle high load scenarios more gracefully. The changes introduce queue-based capacity limits, timeout-based task dropping, and retry logic for capacity-constrained operations.
Key changes:
- Replaces Semaphore-based inflight limiting with BlockingQueue and timeout-based overload detection in SnapshotReadCache
- Adds blocking queues with capacity limits to RouterInV2 and implements retry logic for queue insertion
- Implements infinite retry with sleep for OverCapacityException in ObjectRouterChannel
- Adds exception handling for proxy operations in RouterOutV2
- Adjusts resource cleanup timing in DefaultLinkRecordDecoder
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| s3stream/src/main/java/com/automq/stream/s3/cache/SnapshotReadCache.java | Implements queue-based overload protection with timeout detection and task dropping mechanism |
| core/src/main/java/kafka/automq/zerozone/RouterOutV2.java | Adds exception handling with proper error responses for failed proxy operations |
| core/src/main/java/kafka/automq/zerozone/RouterInV2.java | Replaces unbounded queue with bounded BlockingQueue and adds blocking put with retry loop |
| core/src/main/java/kafka/automq/zerozone/ObjectRouterChannel.java | Implements synchronous retry loop with sleep for handling capacity exceptions |
| core/src/main/java/kafka/automq/zerozone/DefaultLinkRecordDecoder.java | Moves resource release from finally block to async callback for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/main/java/kafka/automq/zerozone/ObjectRouterChannel.java
Outdated
Show resolved
Hide resolved
s3stream/src/main/java/com/automq/stream/s3/cache/SnapshotReadCache.java
Show resolved
Hide resolved
s3stream/src/main/java/com/automq/stream/s3/cache/SnapshotReadCache.java
Show resolved
Hide resolved
s3stream/src/main/java/com/automq/stream/s3/cache/SnapshotReadCache.java
Show resolved
Hide resolved
Signed-off-by: Robin Han <[email protected]>
Signed-off-by: Robin Han <[email protected]>
Signed-off-by: Robin Han <[email protected]>
No description provided.