You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "tomicooler (via GitHub)" <gi...@apache.org> on 2023/09/27 10:12:47 UTC
[GitHub] [hadoop] tomicooler opened a new pull request, #6120: YARN-11578. Cache fs supports chmod in LogAggregationFileController.
tomicooler opened a new pull request, #6120:
URL: https://github.com/apache/hadoop/pull/6120
The check introduced in YARN-10901 to avoid a warn message in NN logs in certain situations (when /tmp/logs is not owned by the yarn user), but it adds 3 NameNode calls (create, setpermission, delete) during log aggregation collection, for every NM.
Meaning, when a YARN job completes, at the YARN log aggregation phase this check is done for every job, from every NodeManager.
In 30 minutes 4.2 % of all the NameNode calls were due to this in a cluster. "write" calls need a Namesystem writeLock as well, so the impact is bigger.
Change-Id: I65468aa972860d3b62050fcb41b8b06e417ee8bb
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g., 'HADOOP-17799. Your PR title ...'.
-->
### Description of PR
Added a static concurrent cache that maps the `<FS class type + Log Path>` to the check `result`.
**Two assumptions:**
- the permissions won't change while the NMs are running
- the key <FS class + Log Path> won't grow big
If these two assumptions are not met, we might need to come up with a different idea.
### How was this patch tested?
Added some debug for demo:
```
final FsLogPathKey key = new FsLogPathKey(remoteFS.getClass(), qualified);
FileSystem finalRemoteFS = remoteFS;
+ System.out.println("checking logdir " + qualified);
FS_CHMOD_CACHE.computeIfAbsent(key, k -> {
+ System.out.println(" computeIfAbsent " + qualified);
fsSupportsChmod = checkFsSupportsChmod(finalRemoteFS, remoteRootLogDir, qualified);
return fsSupportsChmod;
});
```
Added some extra calls to `testRemoteDirCreationWithCustomUser`, the actual checking is only done once:
```
checking logdir /tmp/logs
computeIfAbsent /tmp/logs
checking logdir /tmp/logs
checking logdir /tmp/logs
checking logdir /tmp/logs
```
### For code changes:
- [x] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'YARN-11578. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files?
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
Re: [PR] YARN-11578. Cache fs supports chmod in LogAggregationFileController. [hadoop]
Posted by "tomicooler (via GitHub)" <gi...@apache.org>.
tomicooler commented on PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#issuecomment-1743093089
@brumi1024
- branch-3.3: https://github.com/apache/hadoop/pull/6142
- branch-3.2: https://github.com/apache/hadoop/pull/6143
There were conflicts on both branches, need to wait for Yetus.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
[GitHub] [hadoop] hadoop-yetus commented on pull request #6120: YARN-11578. Cache fs supports chmod in LogAggregationFileController.
Posted by "hadoop-yetus (via GitHub)" <gi...@apache.org>.
hadoop-yetus commented on PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#issuecomment-1738491387
:confetti_ball: **+1 overall**
| Vote | Subsystem | Runtime | Logfile | Comment |
|:----:|----------:|--------:|:--------:|:-------:|
| +0 :ok: | reexec | 0m 49s | | Docker mode activated. |
|||| _ Prechecks _ |
| +1 :green_heart: | dupname | 0m 0s | | No case conflicting files found. |
| +0 :ok: | codespell | 0m 1s | | codespell was not available. |
| +0 :ok: | detsecrets | 0m 1s | | detect-secrets was not available. |
| +1 :green_heart: | @author | 0m 0s | | The patch does not contain any @author tags. |
| +1 :green_heart: | test4tests | 0m 0s | | The patch appears to include 1 new or modified test files. |
|||| _ trunk Compile Tests _ |
| +1 :green_heart: | mvninstall | 48m 57s | | trunk passed |
| +1 :green_heart: | compile | 0m 45s | | trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | compile | 0m 39s | | trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | checkstyle | 0m 36s | | trunk passed |
| +1 :green_heart: | mvnsite | 0m 45s | | trunk passed |
| +1 :green_heart: | javadoc | 0m 54s | | trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | javadoc | 0m 46s | | trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | spotbugs | 1m 46s | | trunk passed |
| +1 :green_heart: | shadedclient | 38m 36s | | branch has no errors when building and testing our client artifacts. |
|||| _ Patch Compile Tests _ |
| +1 :green_heart: | mvninstall | 0m 36s | | the patch passed |
| +1 :green_heart: | compile | 0m 39s | | the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | javac | 0m 39s | | the patch passed |
| +1 :green_heart: | compile | 0m 33s | | the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | javac | 0m 33s | | the patch passed |
| +1 :green_heart: | blanks | 0m 0s | | The patch has no blanks issues. |
| +1 :green_heart: | checkstyle | 0m 26s | | the patch passed |
| +1 :green_heart: | mvnsite | 0m 36s | | the patch passed |
| +1 :green_heart: | javadoc | 0m 41s | | the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | javadoc | 0m 40s | | the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | spotbugs | 1m 44s | | the patch passed |
| +1 :green_heart: | shadedclient | 39m 10s | | patch has no errors when building and testing our client artifacts. |
|||| _ Other Tests _ |
| +1 :green_heart: | unit | 5m 23s | | hadoop-yarn-common in the patch passed. |
| +1 :green_heart: | asflicense | 0m 34s | | The patch does not generate ASF License warnings. |
| | | 148m 21s | | |
| Subsystem | Report/Notes |
|----------:|:-------------|
| Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6120/2/artifact/out/Dockerfile |
| GITHUB PR | https://github.com/apache/hadoop/pull/6120 |
| Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
| uname | Linux 29e059263727 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev-support/bin/hadoop.sh |
| git revision | trunk / c5f4c67b48dd4350f54225b43ac2321a0ffa1e30 |
| Default Java | Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| Multi-JDK versions | /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6120/2/testReport/ |
| Max. process+thread count | 594 (vs. ulimit of 5500) |
| modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common |
| Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6120/2/console |
| versions | git=2.25.1 maven=3.6.3 spotbugs=4.2.2 |
| Powered by | Apache Yetus 0.14.0 https://yetus.apache.org |
This message was automatically generated.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
Re: [PR] YARN-11578. Cache fs supports chmod in LogAggregationFileController. [hadoop]
Posted by "brumi1024 (via GitHub)" <gi...@apache.org>.
brumi1024 commented on PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#issuecomment-1743034385
Additionally, @tomicooler can you please do the backports for 3.3 and 3.2 branches?
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
[GitHub] [hadoop] slfan1989 commented on a diff in pull request #6120: YARN-11578. Cache fs supports chmod in LogAggregationFileController.
Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on code in PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#discussion_r1341880623
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java:
##########
@@ -429,26 +460,34 @@ public void verifyAndCreateRemoteLogDir() {
+ remoteRootLogDir + "]", e);
}
} else {
- //Check if FS has capability to set/modify permissions
- Path permissionCheckFile = new Path(qualified, String.format("%s.permission_check",
- RandomStringUtils.randomAlphanumeric(8)));
+ final FsLogPathKey key = new FsLogPathKey(remoteFS.getClass(), qualified);
+ FileSystem finalRemoteFS = remoteFS;
+ fsSupportsChmod = FS_CHMOD_CACHE.computeIfAbsent(key,
+ k -> checkFsSupportsChmod(finalRemoteFS, remoteRootLogDir, qualified));
+ }
+ }
+
+ private boolean checkFsSupportsChmod(FileSystem remoteFS, Path logDir, Path qualified) {
+ //Check if FS has capability to set/modify permissions
+ Path permissionCheckFile = new Path(qualified, String.format("%s.permission_check",
+ RandomStringUtils.randomAlphanumeric(8)));
+ try {
+ remoteFS.createNewFile(permissionCheckFile);
+ remoteFS.setPermission(permissionCheckFile, new FsPermission(TLDIR_PERMISSIONS));
+ return true;
+ } catch (UnsupportedOperationException use) {
+ LOG.info("Unable to set permissions for configured filesystem since"
+ + " it does not support this {}", remoteFS.getScheme());
+ } catch (IOException e) {
+ LOG.warn("Failed to check if FileSystem supports permissions on "
Review Comment:
In the log we should use {}.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
Re: [PR] YARN-11578. Cache fs supports chmod in LogAggregationFileController. [hadoop]
Posted by "hadoop-yetus (via GitHub)" <gi...@apache.org>.
hadoop-yetus commented on PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#issuecomment-1742620975
:confetti_ball: **+1 overall**
| Vote | Subsystem | Runtime | Logfile | Comment |
|:----:|----------:|--------:|:--------:|:-------:|
| +0 :ok: | reexec | 0m 29s | | Docker mode activated. |
|||| _ Prechecks _ |
| +1 :green_heart: | dupname | 0m 0s | | No case conflicting files found. |
| +0 :ok: | codespell | 0m 0s | | codespell was not available. |
| +0 :ok: | detsecrets | 0m 0s | | detect-secrets was not available. |
| +1 :green_heart: | @author | 0m 0s | | The patch does not contain any @author tags. |
| +1 :green_heart: | test4tests | 0m 0s | | The patch appears to include 1 new or modified test files. |
|||| _ trunk Compile Tests _ |
| +1 :green_heart: | mvninstall | 33m 15s | | trunk passed |
| +1 :green_heart: | compile | 0m 34s | | trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | compile | 0m 32s | | trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | checkstyle | 0m 30s | | trunk passed |
| +1 :green_heart: | mvnsite | 0m 36s | | trunk passed |
| +1 :green_heart: | javadoc | 0m 42s | | trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | javadoc | 0m 37s | | trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | spotbugs | 1m 12s | | trunk passed |
| +1 :green_heart: | shadedclient | 21m 31s | | branch has no errors when building and testing our client artifacts. |
|||| _ Patch Compile Tests _ |
| +1 :green_heart: | mvninstall | 0m 26s | | the patch passed |
| +1 :green_heart: | compile | 0m 28s | | the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | javac | 0m 28s | | the patch passed |
| +1 :green_heart: | compile | 0m 25s | | the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | javac | 0m 25s | | the patch passed |
| +1 :green_heart: | blanks | 0m 0s | | The patch has no blanks issues. |
| +1 :green_heart: | checkstyle | 0m 18s | | the patch passed |
| +1 :green_heart: | mvnsite | 0m 27s | | the patch passed |
| +1 :green_heart: | javadoc | 0m 29s | | the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | javadoc | 0m 29s | | the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | spotbugs | 1m 4s | | the patch passed |
| +1 :green_heart: | shadedclient | 21m 6s | | patch has no errors when building and testing our client artifacts. |
|||| _ Other Tests _ |
| +1 :green_heart: | unit | 4m 39s | | hadoop-yarn-common in the patch passed. |
| +1 :green_heart: | asflicense | 0m 28s | | The patch does not generate ASF License warnings. |
| | | 92m 26s | | |
| Subsystem | Report/Notes |
|----------:|:-------------|
| Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6120/3/artifact/out/Dockerfile |
| GITHUB PR | https://github.com/apache/hadoop/pull/6120 |
| Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
| uname | Linux 9b2948fff24c 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev-support/bin/hadoop.sh |
| git revision | trunk / 0e0b977660914a7dd64cc83a530b86aa9cc272e9 |
| Default Java | Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| Multi-JDK versions | /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6120/3/testReport/ |
| Max. process+thread count | 684 (vs. ulimit of 5500) |
| modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common |
| Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6120/3/console |
| versions | git=2.25.1 maven=3.6.3 spotbugs=4.2.2 |
| Powered by | Apache Yetus 0.14.0 https://yetus.apache.org |
This message was automatically generated.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
Re: [PR] YARN-11578. Cache fs supports chmod in LogAggregationFileController. [hadoop]
Posted by "brumi1024 (via GitHub)" <gi...@apache.org>.
brumi1024 commented on code in PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#discussion_r1342481403
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java:
##########
@@ -429,26 +460,34 @@ public void verifyAndCreateRemoteLogDir() {
+ remoteRootLogDir + "]", e);
}
} else {
- //Check if FS has capability to set/modify permissions
- Path permissionCheckFile = new Path(qualified, String.format("%s.permission_check",
- RandomStringUtils.randomAlphanumeric(8)));
+ final FsLogPathKey key = new FsLogPathKey(remoteFS.getClass(), qualified);
+ FileSystem finalRemoteFS = remoteFS;
+ fsSupportsChmod = FS_CHMOD_CACHE.computeIfAbsent(key,
+ k -> checkFsSupportsChmod(finalRemoteFS, remoteRootLogDir, qualified));
+ }
+ }
+
+ private boolean checkFsSupportsChmod(FileSystem remoteFS, Path logDir, Path qualified) {
+ //Check if FS has capability to set/modify permissions
+ Path permissionCheckFile = new Path(qualified, String.format("%s.permission_check",
+ RandomStringUtils.randomAlphanumeric(8)));
+ try {
+ remoteFS.createNewFile(permissionCheckFile);
+ remoteFS.setPermission(permissionCheckFile, new FsPermission(TLDIR_PERMISSIONS));
+ return true;
+ } catch (UnsupportedOperationException use) {
+ LOG.info("Unable to set permissions for configured filesystem since"
+ + " it does not support this {}", remoteFS.getScheme());
+ } catch (IOException e) {
+ LOG.warn("Failed to check if FileSystem supports permissions on "
+ + "remoteLogDir [" + logDir + "]", e);
+ } finally {
try {
- remoteFS.createNewFile(permissionCheckFile);
- remoteFS.setPermission(permissionCheckFile, new FsPermission(TLDIR_PERMISSIONS));
- } catch (UnsupportedOperationException use) {
- LOG.info("Unable to set permissions for configured filesystem since"
- + " it does not support this {}", remoteFS.getScheme());
- fsSupportsChmod = false;
Review Comment:
Based on the naming and the context I think we can go ahead with the modified behaviour: only set it to true when everything succeeds.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
Re: [PR] YARN-11578. Cache fs supports chmod in LogAggregationFileController. [hadoop]
Posted by "brumi1024 (via GitHub)" <gi...@apache.org>.
brumi1024 commented on PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#issuecomment-1742709497
Thanks @tomicooler for the patch, LGTM. @slfan1989 do you have anything, or are you ok with this being merged?
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
[GitHub] [hadoop] tomicooler commented on a diff in pull request #6120: YARN-11578. Cache fs supports chmod in LogAggregationFileController.
Posted by "tomicooler (via GitHub)" <gi...@apache.org>.
tomicooler commented on code in PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#discussion_r1339564280
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java:
##########
@@ -429,26 +460,34 @@ public void verifyAndCreateRemoteLogDir() {
+ remoteRootLogDir + "]", e);
}
} else {
- //Check if FS has capability to set/modify permissions
- Path permissionCheckFile = new Path(qualified, String.format("%s.permission_check",
- RandomStringUtils.randomAlphanumeric(8)));
+ final FsLogPathKey key = new FsLogPathKey(remoteFS.getClass(), qualified);
+ FileSystem finalRemoteFS = remoteFS;
+ fsSupportsChmod = FS_CHMOD_CACHE.computeIfAbsent(key,
+ k -> checkFsSupportsChmod(finalRemoteFS, remoteRootLogDir, qualified));
+ }
+ }
+
+ private boolean checkFsSupportsChmod(FileSystem remoteFS, Path logDir, Path qualified) {
+ //Check if FS has capability to set/modify permissions
+ Path permissionCheckFile = new Path(qualified, String.format("%s.permission_check",
+ RandomStringUtils.randomAlphanumeric(8)));
+ try {
+ remoteFS.createNewFile(permissionCheckFile);
+ remoteFS.setPermission(permissionCheckFile, new FsPermission(TLDIR_PERMISSIONS));
+ return true;
+ } catch (UnsupportedOperationException use) {
+ LOG.info("Unable to set permissions for configured filesystem since"
+ + " it does not support this {}", remoteFS.getScheme());
+ } catch (IOException e) {
+ LOG.warn("Failed to check if FileSystem supports permissions on "
+ + "remoteLogDir [" + logDir + "]", e);
+ } finally {
try {
- remoteFS.createNewFile(permissionCheckFile);
- remoteFS.setPermission(permissionCheckFile, new FsPermission(TLDIR_PERMISSIONS));
- } catch (UnsupportedOperationException use) {
- LOG.info("Unable to set permissions for configured filesystem since"
- + " it does not support this {}", remoteFS.getScheme());
- fsSupportsChmod = false;
Review Comment:
Note for reviewers. Prior to this change, `fsSupportsChmod` was only set to false when the `UnsupportedOperationException` was thrown, otherwise `fsSupportsChmod` was not modified (by default it was set to true).
Now `fsSupportsChmod` can be updated (set to true when everything succeeds) or false when anything fails. Alternatively we could set it to false only when `UnsupportedOperationException` is thrown and set it to true only when everything succeeds otherwise keeping it as-is.
Or keep the original behaviour.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
[GitHub] [hadoop] tomicooler commented on a diff in pull request #6120: YARN-11578. Cache fs supports chmod in LogAggregationFileController.
Posted by "tomicooler (via GitHub)" <gi...@apache.org>.
tomicooler commented on code in PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#discussion_r1339435762
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java:
##########
@@ -429,26 +460,36 @@ public void verifyAndCreateRemoteLogDir() {
+ remoteRootLogDir + "]", e);
}
} else {
- //Check if FS has capability to set/modify permissions
- Path permissionCheckFile = new Path(qualified, String.format("%s.permission_check",
- RandomStringUtils.randomAlphanumeric(8)));
+ final FsLogPathKey key = new FsLogPathKey(remoteFS.getClass(), qualified);
+ FileSystem finalRemoteFS = remoteFS;
+ FS_CHMOD_CACHE.computeIfAbsent(key, k -> {
+ fsSupportsChmod = checkFsSupportsChmod(finalRemoteFS, remoteRootLogDir, qualified);
+ return fsSupportsChmod;
+ });
+ }
Review Comment:
TODO: missed the get part where the member fsSupportsChmod is updated.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
Re: [PR] YARN-11578. Cache fs supports chmod in LogAggregationFileController. [hadoop]
Posted by "brumi1024 (via GitHub)" <gi...@apache.org>.
brumi1024 merged PR #6120:
URL: https://github.com/apache/hadoop/pull/6120
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
[GitHub] [hadoop] hadoop-yetus commented on pull request #6120: YARN-11578. Cache fs supports chmod in LogAggregationFileController.
Posted by "hadoop-yetus (via GitHub)" <gi...@apache.org>.
hadoop-yetus commented on PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#issuecomment-1737328534
:broken_heart: **-1 overall**
| Vote | Subsystem | Runtime | Logfile | Comment |
|:----:|----------:|--------:|:--------:|:-------:|
| +0 :ok: | reexec | 0m 50s | | Docker mode activated. |
|||| _ Prechecks _ |
| +1 :green_heart: | dupname | 0m 0s | | No case conflicting files found. |
| +0 :ok: | codespell | 0m 0s | | codespell was not available. |
| +0 :ok: | detsecrets | 0m 0s | | detect-secrets was not available. |
| +1 :green_heart: | @author | 0m 0s | | The patch does not contain any @author tags. |
| -1 :x: | test4tests | 0m 0s | | The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. |
|||| _ trunk Compile Tests _ |
| +1 :green_heart: | mvninstall | 52m 52s | | trunk passed |
| +1 :green_heart: | compile | 0m 45s | | trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | compile | 0m 40s | | trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | checkstyle | 0m 36s | | trunk passed |
| +1 :green_heart: | mvnsite | 0m 46s | | trunk passed |
| +1 :green_heart: | javadoc | 0m 54s | | trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | javadoc | 0m 46s | | trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | spotbugs | 1m 45s | | trunk passed |
| +1 :green_heart: | shadedclient | 38m 40s | | branch has no errors when building and testing our client artifacts. |
|||| _ Patch Compile Tests _ |
| +1 :green_heart: | mvninstall | 0m 36s | | the patch passed |
| +1 :green_heart: | compile | 0m 40s | | the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | javac | 0m 40s | | the patch passed |
| +1 :green_heart: | compile | 0m 34s | | the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | javac | 0m 34s | | the patch passed |
| +1 :green_heart: | blanks | 0m 1s | | The patch has no blanks issues. |
| +1 :green_heart: | checkstyle | 0m 26s | | the patch passed |
| +1 :green_heart: | mvnsite | 0m 37s | | the patch passed |
| +1 :green_heart: | javadoc | 0m 41s | | the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 |
| +1 :green_heart: | javadoc | 0m 40s | | the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| +1 :green_heart: | spotbugs | 1m 42s | | the patch passed |
| +1 :green_heart: | shadedclient | 38m 52s | | patch has no errors when building and testing our client artifacts. |
|||| _ Other Tests _ |
| +1 :green_heart: | unit | 5m 22s | | hadoop-yarn-common in the patch passed. |
| +1 :green_heart: | asflicense | 0m 34s | | The patch does not generate ASF License warnings. |
| | | 152m 18s | | |
| Subsystem | Report/Notes |
|----------:|:-------------|
| Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6120/1/artifact/out/Dockerfile |
| GITHUB PR | https://github.com/apache/hadoop/pull/6120 |
| Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
| uname | Linux 4298a1771681 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev-support/bin/hadoop.sh |
| git revision | trunk / ab182cd5fe53cdb413753ecb778d61e28451ad86 |
| Default Java | Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| Multi-JDK versions | /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
| Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6120/1/testReport/ |
| Max. process+thread count | 529 (vs. ulimit of 5500) |
| modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common |
| Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6120/1/console |
| versions | git=2.25.1 maven=3.6.3 spotbugs=4.2.2 |
| Powered by | Apache Yetus 0.14.0 https://yetus.apache.org |
This message was automatically generated.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org
[GitHub] [hadoop] tomicooler commented on a diff in pull request #6120: YARN-11578. Cache fs supports chmod in LogAggregationFileController.
Posted by "tomicooler (via GitHub)" <gi...@apache.org>.
tomicooler commented on code in PR #6120:
URL: https://github.com/apache/hadoop/pull/6120#discussion_r1342340726
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java:
##########
@@ -429,26 +460,34 @@ public void verifyAndCreateRemoteLogDir() {
+ remoteRootLogDir + "]", e);
}
} else {
- //Check if FS has capability to set/modify permissions
- Path permissionCheckFile = new Path(qualified, String.format("%s.permission_check",
- RandomStringUtils.randomAlphanumeric(8)));
+ final FsLogPathKey key = new FsLogPathKey(remoteFS.getClass(), qualified);
+ FileSystem finalRemoteFS = remoteFS;
+ fsSupportsChmod = FS_CHMOD_CACHE.computeIfAbsent(key,
+ k -> checkFsSupportsChmod(finalRemoteFS, remoteRootLogDir, qualified));
+ }
+ }
+
+ private boolean checkFsSupportsChmod(FileSystem remoteFS, Path logDir, Path qualified) {
+ //Check if FS has capability to set/modify permissions
+ Path permissionCheckFile = new Path(qualified, String.format("%s.permission_check",
+ RandomStringUtils.randomAlphanumeric(8)));
+ try {
+ remoteFS.createNewFile(permissionCheckFile);
+ remoteFS.setPermission(permissionCheckFile, new FsPermission(TLDIR_PERMISSIONS));
+ return true;
+ } catch (UnsupportedOperationException use) {
+ LOG.info("Unable to set permissions for configured filesystem since"
+ + " it does not support this {}", remoteFS.getScheme());
+ } catch (IOException e) {
+ LOG.warn("Failed to check if FileSystem supports permissions on "
Review Comment:
Thanks for the review. Fixed it.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org