mvanhorn opened a new pull request, #4443: URL: https://github.com/apache/hertzbeat/pull/4443
## What's changed? Each queue is now constructed with a fixed capacity of 10_000. Single and batch send paths use non-blocking offer and discard the incoming entry when the queue is full, while entries already queued stay in FIFO order. Each discard is counted, and each queue emits at most one warning per minute that names the queue, the capacity, and the discard count and leaves the metric or log body out of the message. The limit is an entry count; installations that need durable buffering should use an external queue. With the default in-memory queue, HertzBeat eventually throws java.lang.OutOfMemoryError: GC overhead limit exceeded, stops responding, and the console can no longer be used. Collected metrics and logs keep accumulating on the master while alerting or storage falls behind. InMemoryCommonDataQueue built each of its five LinkedBlockingQueues with no capacity, so every offer added another entry. A stalled consumer therefore left metrics, logs, and service-discovery data to grow on the heap with no entry ceiling. Fixes #1714 ## Checklist - [ ] I have read the [Contributing Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide) - [ ] I have written the necessary doc or comment. Left unticked: this change to `hertzbeat-common-spring/src/main/java/org/apache/hertzbeat/common/queue/impl/InMemoryCommonDataQueue.java` touches no documentation. - [x] I have added the necessary unit tests and all cases have passed. ## Add or update API - [ ] I have added the necessary [e2e tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have passed. Not claimed: the tests this diff adds (`hertzbeat-common-spring/src/test/java/org/apache/hertzbeat/common/queue/impl/InMemoryCommonDataQueueTest.java`) are not e2e tests. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
