ratis-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lokesh Jain (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (RATIS-878) Infinite restart of LogAppender
Date Mon, 29 Jun 2020 06:10:00 GMT

    [ https://issues.apache.org/jira/browse/RATIS-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147572#comment-17147572
] 

Lokesh Jain edited comment on RATIS-878 at 6/29/20, 6:09 AM:
-------------------------------------------------------------

[~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 in the above function 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.


was (Author: ljain):
[~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)

Mime
View raw message