[
https://issues.apache.org/jira/browse/RATIS-1622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17566084#comment-17566084
]
Tsz-wo Sze commented on RATIS-1622:
-----------------------------------
bq. ... if the follower is down, then it will keep looping, right? ...
Right, shouldSendAppendEntries() will keep returning true. How about we
enforce a min wait time as below?
{code}
static final long WAIT_TIME_MIN_MS = 10L;
private long getWaitTimeMs() {
final long lastHeartbeatElapsedMs =
getFollower().getLastHeartbeatSendTime().elapsedTimeMs();
if (lastHeartbeatElapsedMs < WAIT_TIME_MIN_MS) {
return WAIT_TIME_MIN_MS - lastHeartbeatElapsedMs;
}
return shouldSendAppendEntries()? 0L: getHeartbeatWaitTimeMs();
}
{code}
> High cpu usage of LogAppenderDaemon
> -----------------------------------
>
> Key: RATIS-1622
> URL: https://issues.apache.org/jira/browse/RATIS-1622
> Project: Ratis
> Issue Type: Improvement
> Components: server
> Reporter: Tsz-wo Sze
> Assignee: Riguz Lee
> Priority: Major
> Attachments: image-2022-07-12-15-39-40-948.png,
> image-2022-07-12-15-40-29-685.png, image-2022-07-12-15-50-40-036.png,
> image-2022-07-12-19-20-06-014.png
>
>
> As reported by Riguz Lee in
> https://lists.apache.org/thread/p5hq3nr1zqpkgd3fr0vyx9j5d2lx6gf9 ,
> LogAppenderDaemon has a high cpu usage.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)