You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ey...@apache.org on 2020/05/20 16:28:43 UTC
[hadoop] reference refs/remotes/origin/branch-3.3 updated (e452163
-> 18a7cbf)
This is an automated email from the ASF dual-hosted git repository.
eyang pushed a change to reference refs/remotes/origin/branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git.
from e452163 HDFS-15293. Relax the condition for accepting a fsimage when receiving a checkpoint. Contributed by Chen Liang
new 18a7cbf YARN-10228. Relax restriction of file path character in yarn.service.am.java.opts. Contributed by Bilwa S T via eyang
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../hadoop/yarn/service/utils/ServiceApiUtil.java | 2 +-
.../hadoop/yarn/service/utils/TestServiceApiUtil.java | 19 +++++++++++++++----
2 files changed, 16 insertions(+), 5 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org
[hadoop] 01/01: YARN-10228. Relax restriction of file path
character in yarn.service.am.java.opts. Contributed by Bilwa S T via eyang
Posted by ey...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
eyang pushed a commit to reference refs/remotes/origin/branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
commit 18a7cbf071573310fa03726ba986594efb7b273d
Author: Eric Yang <ey...@apache.org>
AuthorDate: Wed May 20 09:20:53 2020 -0700
YARN-10228. Relax restriction of file path character in yarn.service.am.java.opts.
Contributed by Bilwa S T via eyang
---
.../hadoop/yarn/service/utils/ServiceApiUtil.java | 2 +-
.../hadoop/yarn/service/utils/TestServiceApiUtil.java | 19 +++++++++++++++----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java
index 3780c99..5e7a335 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java
@@ -250,7 +250,7 @@ public class ServiceApiUtil {
public static void validateJvmOpts(String jvmOpts)
throws IllegalArgumentException {
- Pattern pattern = Pattern.compile("[!~#?@*&%${}()<>\\[\\]|\"\\/,`;]");
+ Pattern pattern = Pattern.compile("[!~#?@*&%${}()<>\\[\\]|\",`;]");
Matcher matcher = pattern.matcher(jvmOpts);
if (matcher.find()) {
throw new IllegalArgumentException(
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
index a93f3d9..2a61171 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
@@ -46,10 +46,12 @@ import java.util.Collections;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.apache.hadoop.test.LambdaTestUtils.intercept;
import static org.apache.hadoop.yarn.service.conf.RestApiConstants.DEFAULT_UNLIMITED_LIFETIME;
import static org.apache.hadoop.yarn.service.exceptions.RestApiErrorMessages.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
/**
* Test for ServiceApiUtil helper methods.
@@ -766,10 +768,19 @@ public class TestServiceApiUtil extends ServiceTestUtils {
Assert.assertTrue(thread.isAlive());
}
- @Test(expected = IllegalArgumentException.class)
- public void testJvmOpts() {
- String jvmOpts = "`ping -c 3 example.com`";
- ServiceApiUtil.validateJvmOpts(jvmOpts);
+ @Test
+ public void testJvmOpts() throws Exception {
+ String invalidJvmOpts = "`ping -c 3 example.com`";
+ intercept(IllegalArgumentException.class,
+ "Invalid character in yarn.service.am.java.opts.",
+ () -> ServiceApiUtil.validateJvmOpts(invalidJvmOpts));
+ String validJvmOpts = "-Dyarn.service.am.java.opts=-Xmx768m "
+ + "-Djava.security.auth.login.config=/opt/hadoop/etc/jaas-zk.conf";
+ try {
+ ServiceApiUtil.validateJvmOpts(validJvmOpts);
+ } catch (Exception ex) {
+ fail("Invalid character in yarn.service.am.java.opts.");
+ }
}
public static Service createExampleApplication() {
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org