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

ASF GitHub Bot commented on HDFS-17546:
---------------------------------------

NyteKnight opened a new pull request, #6891:
URL: https://github.com/apache/hadoop/pull/6891

   ### Description of PR
   In hadoop environments that rely on NAS to house dfs.hosts file, during FS 
hangs (for any reason) the refreshNodes call would infinitely hang (causing a 
blocked thread) until the FS returns. 
   This is due to how Java's Filestream works here:
   ```
     try (Reader input =
             new InputStreamReader(
                 Files.newInputStream(hostFile.toPath()), 
StandardCharsets.UTF_8)) {
           allDNs = objectMapper.readValue(input, 
DatanodeAdminProperties[].class);
         } catch (JsonMappingException jme) {
   ```
   In order to fix this we introduce a method  (+ new config value) which (if 
set) encapsulates the original method in a `Future.Task`. If the Task 

> Implementing Timeout for HostFileReader when FS hangs
> -----------------------------------------------------
>
>                 Key: HDFS-17546
>                 URL: https://issues.apache.org/jira/browse/HDFS-17546
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>            Reporter: Simbarashe Dzinamarira
>            Assignee: Heagan
>            Priority: Minor
>              Labels: pull-request-available
>
> Certain implementations of Hadoop have the dfs.hosts file residing on NAS/NFS 
> and potentially with symlinks. If the FS hangs for any reason, the 
> refreshNodes call would infinitely hang on the HostsFileReader until the FS 
> returns.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to