xinglin commented on PR #6266:
URL: https://github.com/apache/hadoop/pull/6266#issuecomment-1817623782

   thanks @haiyang1987.  The name of`getActiveNodeProxy()` caused the 
confusion. It should probably have been named as `getAliveNodeProxy`. ActiveNN 
has a specific meaning in the context of HA-NN. `getActiveNodeProxy` indeed 
iterates over all NNs.
   
   Neither `MultipleNameNodeProxy.call() or 
MultipleNameNodeProxy.getActiveNodeProxy()` catch InterruptedExecution in their 
try_catch block. 
   
   have two dummy questions
   
   Question 1: 
   when we submit a task to an executorService and later on we cancel it due to 
timeout, and we don't capture interrupted exception in our task, what state 
will the thread from executorService be left? Do we have to capture interrupted 
exception in our task in this case?
   
   ob1 trying to connect to ob2. we timed out after 60 sec. Are you saying the 
thread in the executorService would still be in Interrupted state, even though 
we have throw up the Interrupted Execution, as showed in the log (also because 
it is not captured within MultipleNameNodeProxy)? This seems to be 
contradicting to a statement I found from below blog, which says when an 
interruptedExecution is threw, the interruption status of that thread will be 
cleared.
   
   "Before a blocking code throws an InterruptedException, it marks the 
interruption status as false." 
   
https://praveer09.github.io/technology/2015/12/06/understanding-thread-interruption-in-java/
   
   Another question:  assuming the thread in the executorService is still in 
interrupted state, then how is it gotten cleared by your PR? 
`Thread.currentThread().isInterrupted()` will not clear the interrupt flag for 
a thread, as the Oracle Java doc says.
   
   > When a thread checks for an interrupt by invoking the static method 
Thread.interrupted, interrupt status is cleared. The non-static isInterrupted 
method, which is used by one thread to query the interrupt status of another, 
does not change the interrupt status flag.
   
https://docs.oracle.com/javase/tutorial/essential/concurrency/interrupt.html#:~:text=When%20a%20thread%20checks%20for,change%20the%20interrupt%20status%20flag.


-- 
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