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

Hongbing Wang commented on HDFS-15641:
--------------------------------------

I adjusted the thread start sequence in BPServiceActor to ensure that the first 
thread (*{color:#172b4d}lifelineSender{color}*) has acquired and released the 
read lock before starting the second thread (*bpThread*).

Original code:
{code:java}
void start() {
  if ((bpThread != null) && (bpThread.isAlive())) {
    //Thread is started already
    return;
  }
  bpThread = new Thread(this);
  bpThread.setDaemon(true); // needed for JUnit testing
  bpThread.start();

  if (lifelineSender != null) {
    lifelineSender.start();
  }
}
{code}
New code:
{code:java}
void start() {
  if ((bpThread != null) && (bpThread.isAlive())) {
    //Thread is started already
    return;
  }
  bpThread = new Thread(this);
  bpThread.setDaemon(true); // needed for JUnit testing

  if (lifelineSender != null) {
    lifelineSender.start();
  }
  bpThread.start();
}
{code}

> DataNode could meet deadlock if invoke refreshNameNode
> ------------------------------------------------------
>
>                 Key: HDFS-15641
>                 URL: https://issues.apache.org/jira/browse/HDFS-15641
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 3.2.0
>            Reporter: Hongbing Wang
>            Assignee: Hongbing Wang
>            Priority: Critical
>         Attachments: HDFS-15641.000.test.patch, HDFS-15641.001.patch, 
> deadlock.png, jstack.log
>
>
> DataNode could meet deadlock when invoke `hdfs dfsadmin -refreshNamenodes 
> hostname:50020` to register a new namespace in federation env.
> The jstack is shown in jstack.log
>  The specific process is shown in Figure deadlock.png



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to