slfan1989 commented on PR #4367:
URL: https://github.com/apache/hadoop/pull/4367#issuecomment-1152922067

   > Please refer to the stack:
   
   Thank you very much, I have understood that this is indeed a deadlock, 
because the same thread needs to use both a read lock and a write lock.
   
   > evictBlocks could not successfully acquire the write lock, since 
[createRBW_logic](https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java#L1588)
 holds the read lock of this block pool. And 
[createRBW_logic](https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java#L1588)
 is waiting for evictBlocks to finish. so it's deadlock.
   
   very good explanation.
   
   > I'm interested in this deadlock, can you provide a reproduction process? 
thanks~
   
   Thanks for your patience in explaining, this is my guess, now it looks like 
this won't happen(deadlock) because createRbw And addVolume won't be executed 
in the same thread, and createRbw And LazyWriter won't deadlock because they're 
not executed in one thread.
   
   LGTM +1
   
   > The last question is
   why we first add blockpool readlock, and then add volume write lock, how is 
the order of this lock derived?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to