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

   ### Summary
   
   When `dfs.datanode.directoryscan.threads` is set to 0 or a negative value, 
the DataNode throws `IllegalArgumentException` from 
`Executors.newFixedThreadPool(threads)` during DirectoryScanner initialization 
and fails to start. This change validates the config and uses the default (1) 
when the value is non-positive, with a warning log, so the DataNode starts and 
the operator sees a clear message.
   
   ### Change
   
   - **DirectoryScanner**: After reading `dfs.datanode.directoryscan.threads`, 
if the value is ≤ 0, log a warning (parameter name, invalid value, default) and 
set threads to `DFS_DATANODE_DIRECTORYSCAN_THREADS_DEFAULT` (1) before creating 
the thread pool. Matches the existing pattern used for 
`reconcile.blocks.batch.size` and `reconcile.blocks.batch.interval` in the same 
class.
   - **TestDirectoryScanner**: New test 
`testInvalidDirectoryScanThreadsUsesDefault()` — set `directoryscan.threads` to 
0, build a minimal cluster, create and start DirectoryScanner; verifies no 
exception and scanner runs (HDFS-17824).
   
   ### JIRA
   
   Fixes HDFS-17824
   


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