You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Takanobu Asanuma (Jira)" <ji...@apache.org> on 2022/01/19 07:04:00 UTC

[jira] [Updated] (HDFS-16139) Update BPServiceActor Scheduler's nextBlockReportTime atomically

     [ https://issues.apache.org/jira/browse/HDFS-16139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Takanobu Asanuma updated HDFS-16139:
------------------------------------
    Fix Version/s: 3.3.3

> Update BPServiceActor Scheduler's nextBlockReportTime atomically
> ----------------------------------------------------------------
>
>                 Key: HDFS-16139
>                 URL: https://issues.apache.org/jira/browse/HDFS-16139
>             Project: Hadoop HDFS
>          Issue Type: Task
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.4.0, 3.3.3
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> BPServiceActor#Scheduler's nextBlockReportTime is declared volatile and it can be assigned/read by testing threads (through BPServiceActor#triggerXXX) as well as by actor threads. Hence it is declared volatile but it is still assigned non-atomically
> e.g
> {code:java}
> if (factor != 0) {
>   nextBlockReportTime += factor * blockReportIntervalMs;
> } else {
>   // If the difference between the present time and the scheduled
>   // time is very less, the factor can be 0, so in that case, we can
>   // ignore that negligible time, spent while sending the BRss and
>   // schedule the next BR after the blockReportInterval.
>   nextBlockReportTime += blockReportIntervalMs;
> }
> {code}
> We should convert it to AtomicLong to take care of concurrent assignments while making sure that it is assigned atomically.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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