uncleGen opened a new pull request #26343: [SPARK-29683][YARN] Job will fail 
due to executor failures all available nodes are blacklisted
URL: https://github.com/apache/spark/pull/26343
 
 
   ### What changes were proposed in this pull request?
   
   - Check the nodes in `spark.yarn.exclude.nodes` if exists in Yarn cluster.
   - Loosen condition of checking if all node blacklisted: give a waiting time 
before job failed.
   
   ### Why are the changes needed?
   
   My streaming job will fail due to executor failures all available nodes are 
blacklisted. This exception is thrown only when all node is blacklisted:
   ```
   def isAllNodeBlacklisted: Boolean = currentBlacklistedYarnNodes.size >= 
numClusterNodes
   
   val allBlacklistedNodes = excludeNodes ++ schedulerBlacklist ++ 
allocatorBlacklist.keySet
   ```
   After diving into the code, I found some critical conditions not be handle 
properly:
   - unchecked `excludeNodes`: it comes from user config. If not set properly, 
it may lead to "currentBlacklistedYarnNodes.size >= numClusterNodes". For 
example, we may set some nodes not in Yarn cluster.
   ```
   excludeNodes = (invalid1, invalid2, invalid3)
   clusterNodes = (valid1, valid2)
   ```
   - `numClusterNodes` may equals 0: When HA Yarn failover, it will take some 
time for all NodeManagers to register ResourceManager again. In this case, 
`numClusterNode` may equals 0 or some other number, and Spark driver failed.
   - too strong condition check: Spark driver will fail as long as 
"currentBlacklistedYarnNodes.size >= numClusterNodes". This condition should 
not indicate a unrecovered fatal. For example, there are some NodeManagers 
restarting. So we can give some waiting time before job failed.
   
   
   ### Does this PR introduce any user-facing change?
   No
   
   
   ### How was this patch tested?
   
   - Add new UT and update current UTs.
   - manual test
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to