[
https://issues.apache.org/jira/browse/HDFS-16499?focusedWorklogId=739798&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-739798
]
ASF GitHub Bot logged work on HDFS-16499:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Mar/22 01:08
Start Date: 11/Mar/22 01:08
Worklog Time Spent: 10m
Work Description: tomscut commented on a change in pull request #4058:
URL: https://github.com/apache/hadoop/pull/4058#discussion_r824306593
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/sps/ExternalStoragePolicySatisfier.java
##########
@@ -96,20 +96,28 @@ private static void secureLogin(Configuration conf)
socAddr.getHostName());
}
- private static NameNodeConnector getNameNodeConnector(Configuration conf)
- throws IOException, InterruptedException {
+ public static NameNodeConnector getNameNodeConnector(Configuration conf,
boolean forTest)
+ throws InterruptedException {
final Collection<URI> namenodes = DFSUtil.getInternalNsRpcUris(conf);
final Path externalSPSPathId = HdfsServerConstants.MOVER_ID_PATH;
+ String serverName = ExternalStoragePolicySatisfier.class.getSimpleName();
while (true) {
try {
final List<NameNodeConnector> nncs = NameNodeConnector
.newNameNodeConnectors(namenodes,
- ExternalStoragePolicySatisfier.class.getSimpleName(),
+ serverName,
externalSPSPathId, conf,
NameNodeConnector.DEFAULT_MAX_IDLE_ITERATIONS);
return nncs.get(0);
} catch (IOException e) {
LOG.warn("Failed to connect with namenode", e);
+ if (e.getMessage().equals("Another " + serverName + " is running.")) {
Review comment:
> It's quite some time I looked at this code. Thanks a lot for working
on these improvements. How about using ExitUtil class to terminate. That class
has static methods to disable exit. That you can use it from tests.
Thank you @umamaheswararao very much for your review. And your suggestion
makes sense to me.
I updated the code. PTAL. Thanks.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 739798)
Time Spent: 40m (was: 0.5h)
> [SPS]: Should not start indefinitely while another SPS process is running
> -------------------------------------------------------------------------
>
> Key: HDFS-16499
> URL: https://issues.apache.org/jira/browse/HDFS-16499
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: tomscut
> Assignee: tomscut
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Normally, we can only start one SPS process at a time. When one process is
> running, start another process and retry indefinitely. I think, in this case,
> we should exit immediately.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]