From 8e8cb4c6ca7e803674b160946ac92274bac0f96d Mon Sep 17 00:00:00 2001 From: Vinayakumar B Date: Tue, 14 Jun 2016 15:58:04 +0530 Subject: [PATCH] HADOOP-13179. GenericOptionsParser is not thread-safe because commons-cli OptionBuilder is not thread-safe. (Contributed by hongbin ma) --- .../main/java/org/apache/hadoop/util/GenericOptionsParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java index 17ce730aef..8a06b1f73f 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java @@ -208,7 +208,7 @@ public CommandLine getCommandLine() { * Specify properties of each generic option */ @SuppressWarnings("static-access") - private static Options buildGeneralOptions(Options opts) { + private static synchronized Options buildGeneralOptions(Options opts) { Option fs = OptionBuilder.withArgName("local|namenode:port") .hasArg() .withDescription("specify a namenode")