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

Attila Doroszlai commented on HDDS-2452:
----------------------------------------

The executor may still run tasks after shutdown, it just doesn't accept any new 
ones.  So {{isShutdown}} check is still needed.

> Wrong condition for re-scheduling in ReportPublisher
> ----------------------------------------------------
>
>                 Key: HDDS-2452
>                 URL: https://issues.apache.org/jira/browse/HDDS-2452
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: Ozone Datanode
>            Reporter: Attila Doroszlai
>            Assignee: Sandeep Nemuri
>            Priority: Trivial
>              Labels: newbie
>
> It seems the condition for scheduling next run of {{ReportPublisher}} is 
> wrong:
> {code:title=https://github.com/apache/hadoop-ozone/blob/master/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/report/ReportPublisher.java#L74-L76}
>     if (!executor.isShutdown() ||
>         !(context.getState() == DatanodeStates.SHUTDOWN)) {
>       executor.schedule(this,
> {code}
> Given the condition above, the task may be scheduled again if the executor is 
> shutdown, but the state machine is not set to shutdown (or vice versa).  I 
> think the condition should have an {{&&}}, not {{||}}.  (Currently it is 
> unlikely to happen, since [context state is set to shutdown before the report 
> executor|https://github.com/apache/hadoop-ozone/blob/f928a0bdb4ea2e5195da39256c6dda9f1c855649/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeStateMachine.java#L392-L393].)
> [~nanda], can you please confirm if this is a typo or intentional?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to