Duansg commented on PR #3848:
URL: https://github.com/apache/hertzbeat/pull/3848#issuecomment-3532907320
> > Regarding the retry strategy here, an exponential backoff strategy can
be implemented on the consumer side to prevent rapid failures caused by unknown
exceptions in the queue implementation strategy from resulting in busy waiting
on the consumer side.
> > I will attempt to modify and enhance this strategy in subsequent
iterations.
> > @tomsun28 @starryCoder Do you have any suggestions regarding the
improvements I mentioned above?
>
> If the BRPOP timeout is set to 0 (infinite block), the consumer is only
unblocked when a message arrives or when a connection/network failure occurs.
Therefore, the Exponential Backoff logic for normal queue emptiness is indeed
unnecessary.
That's not what I meant. What I wanted to describe was:
For example: in `RedisCommonDataQueue`
```
try {
return syncCommands.rpop(metricsDataQueueNameToAlerter);
} catch (Exception e) {
return null;
}
```
If a Redis call causes the connection to break due to an unknown exception,
an exception will be thrown immediately and null will be returned. It checks
for an empty condition externally and proceeds to the next iteration of the
loop.
--
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]