You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Lokesh Jain (Jira)" <ji...@apache.org> on 2020/06/29 06:09:00 UTC
[jira] [Commented] (RATIS-878) Infinite restart of LogAppender
[ https://issues.apache.org/jira/browse/RATIS-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147572#comment-17147572 ]
Lokesh Jain commented on RATIS-878:
-----------------------------------
[~yjxxtd]
LogAppender$AppenderDaemon#stop - should ideally transition the lifecycle to CLOSING state. Once transitioned to CLOSING state, LogAppender$AppenderDaemon#run should not restart the appender.
{code:java}
void stop() {
synchronized (lifeCycle) {
if (!isRunning()) {
return;
}
if (lifeCycle.compareAndTransition(NEW, CLOSED)) {
return;
}
lifeCycle.transition(CLOSING);
}
daemon.interrupt();
}{code}
One bug I can see here is that if the state is EXCEPTION, it would return from "if (!isRunning())" check itself without transitioning to CLOSING state. I think it should just check for CLOSING or CLOSED in the if condition.
> Infinite restart of LogAppender
> --------------------------------
>
> Key: RATIS-878
> URL: https://issues.apache.org/jira/browse/RATIS-878
> Project: Ratis
> Issue Type: Bug
> Reporter: runzhiwang
> Assignee: runzhiwang
> Priority: Blocker
>
> The details please refer it here [RATIS-840|https://issues.apache.org/jira/browse/RATIS-840].
--
This message was sent by Atlassian Jira
(v8.3.4#803005)