bigcyy commented on PR #3848:
URL: https://github.com/apache/hertzbeat/pull/3848#issuecomment-3533182366
> @bigcyy Is my understanding correct? Could you take a look?
Thank you for clarifying. I just want to summarize my understanding of the
proposed improvements to make sure I'm on the same page.
As I understand it, the two main suggestions are:
1. Replace RPOP with BRPOP: The goal here is to avoid the consumer thread
from busy-waiting or spinning in a tight loop when the queue is empty. Using
the blocking BRPOP (with an appropriate timeout) is much more efficient and
prevents unnecessary CPU waste.
2. Implement Exponential Backoff for Exceptions: When the consumer
encounters an unexpected exception (such as a network error or a connection
failure, rather than just an empty queue), the thread should not terminate.
Instead, it should implement an exponential backoff strategy for retrying the
connection/operation. This makes the consumer more resilient and prevents it
from either crashing or overwhelming the system with rapid retries during a
failure.
Is my understanding of your proposed solutions correct?
--
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]