Conversation
Implement rate limiting mechanism to protect etcd when: - Cache is empty (no stale data available) - Registry is failing/overloaded - Multiple sequential requests arrive Changes: - Add MinimumRetryInterval option (default 5s) - Track last failed attempt time per service - Throttle requests within retry interval when no cache exists - Clear throttling on successful lookup - Add comprehensive tests validating throttling behavior Co-authored-by: asim <17530+asim@users.noreply.github.com>
|
@copilot unit test fails |
|
@copilot Unit test fails: START| Stream |
The WaitGroup.Add() calls were happening after goroutines started, causing a race where Done() could be called before Add(), resulting in "negative WaitGroup counter" panics. Fixes: - Move wg.Add(1) before goroutine in TestConsumeTopic - Move wg.Add(2) before first goroutine in TestConsumeGroup Co-authored-by: asim <17530+asim@users.noreply.github.com>
Fixed in 2850d50. The WaitGroup.Add() calls were racing with goroutine execution - moved them before the goroutine starts. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Document the new adaptive throttling feature that prevents cache penetration when registry is failing and no stale cache exists. Includes: - Feature overview - Usage examples with configuration options - Explanation of throttling behavior - Example scenario demonstrating protection Co-authored-by: asim <17530+asim@users.noreply.github.com>
Enhanced Cache Penetration Protection for Registry
Problem
While PR #2822 added singleflight protection, it's insufficient when:
Current behavior: Each singleflight attempt fails → returns error → next request tries again → continuous etcd hammering
Solution: Adaptive Request Throttling
Add rate limiting when registry is in error state to prevent cache penetration:
Changes Summary
Registry Cache Throttling (
registry/cache/)MinimumRetryIntervaloption (default 5s)Bug Fix (
events/stream_test.go)wg.Add()calls before goroutine startsDocumentation
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.