adoroszlai commented on code in PR #5456:
URL: https://github.com/apache/ozone/pull/5456#discussion_r1361880761
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconStorageContainerManagerFacade.java:
##########
@@ -366,7 +362,9 @@ public void start() {
"Recon ScmDatanodeProtocol RPC server",
getDatanodeProtocolServer().getDatanodeRpcAddress()));
}
- scheduler = Executors.newScheduledThreadPool(1);
+ scheduler = Executors.newScheduledThreadPool(1,
+ new ThreadFactoryBuilder().setNameFormat(threadNamePrefix)
Review Comment:
`threadNamePrefix` is `Recon-`. We should include some other info in the
thread name, e.g. `SyncSCM`. If you have a better idea, please use that.
Also, let's add a numeric suffix to identify individual threads.
```suggestion
new ThreadFactoryBuilder().setNameFormat(threadNamePrefix +
"SyncSCM-%d")
```
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -228,7 +232,9 @@ public OMMetadataManager getOMMetadataManagerInstance() {
@Override
public void start() {
LOG.info("Starting Ozone Manager Service Provider.");
- scheduler = Executors.newScheduledThreadPool(1);
+ scheduler = Executors.newScheduledThreadPool(1,
+ new ThreadFactoryBuilder().setNameFormat(threadNamePrefix)
Review Comment:
Same comment as for SCM, let's use `threadNamePrefix + "SyncOM-%d"` or
similar as name format. Also, I guess we can store `threadNameFormat` as
instance variable instead of the prefix to avoid duplication.
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskControllerImpl.java:
##########
@@ -219,7 +220,9 @@ public ReconTaskStatusDao getReconTaskStatusDao() {
@Override
public synchronized void start() {
LOG.info("Starting Recon Task Controller.");
- executorService = Executors.newFixedThreadPool(threadCount);
+ executorService = Executors.newFixedThreadPool(threadCount,
+ new ThreadFactoryBuilder().setNameFormat("Recon Task Thread - %d")
Review Comment:
Nit: avoid space in thread name to make it easier to cut columns from log by
whitespace.
```suggestion
new ThreadFactoryBuilder().setNameFormat("ReconTaskThread-%d")
```
--
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]