mirror of https://github.com/apache/kafka.git
This PR introduces an ExpiringErrorCache that temporarily stores topic creation errors, allowing the system to provide detailed failure reasons in subsequent heartbeat responses. Key Designs: Time-based expiration: Errors are cached with a TTL based on the streams group heartbeat interval (2x heartbeat interval). This ensures errors remain available for at least one retry cycle while preventing unbounded growth. 2. Priority queue for efficient expiry: Uses a min-heap to track entries by expiration time, enabling efficient cleanup of expired entries during cache operations. 3. Capacity enforcement: Limits cache size to prevent memory issues under high error rates. When capacity is exceeded, oldest entries are evicted first. 4. Reference equality checks: Uses eq for object identity comparison when cleaning up stale entries, avoiding expensive value comparisons while correctly handling entry updates. Reviewers: Lucas Brutschy <lucasbru@apache.org> |
||
---|---|---|
.. | ||
src | ||
.gitignore |