[ https://issues.apache.org/jira/browse/YARN-11178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17655368#comment-17655368 ]
ASF GitHub Bot commented on YARN-11178: --------------------------------------- hadoop-yetus commented on PR #4435: URL: https://github.com/apache/hadoop/pull/4435#issuecomment-1373425771 :broken_heart: **-1 overall** | Vote | Subsystem | Runtime | Logfile | Comment | |:----:|----------:|--------:|:--------:|:-------:| | +0 :ok: | reexec | 0m 39s | | 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. | | +0 :ok: | xmllint | 0m 0s | | xmllint 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 _ | | +0 :ok: | mvndep | 15m 8s | | Maven dependency ordering for branch | | +1 :green_heart: | mvninstall | 26m 8s | | trunk passed | | +1 :green_heart: | compile | 10m 5s | | trunk passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04 | | +1 :green_heart: | compile | 9m 16s | | trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08 | | +1 :green_heart: | checkstyle | 1m 45s | | trunk passed | | +1 :green_heart: | mvnsite | 3m 13s | | trunk passed | | -1 :x: | javadoc | 1m 1s | [/branch-javadoc-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager-jdkUbuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.txt](https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4435/4/artifact/out/branch-javadoc-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager-jdkUbuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.txt) | hadoop-yarn-server-resourcemanager in trunk failed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04. | | +1 :green_heart: | javadoc | 2m 35s | | trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08 | | +1 :green_heart: | spotbugs | 6m 12s | | trunk passed | | +1 :green_heart: | shadedclient | 21m 53s | | branch has no errors when building and testing our client artifacts. | |||| _ Patch Compile Tests _ | | +0 :ok: | mvndep | 0m 31s | | Maven dependency ordering for patch | | +1 :green_heart: | mvninstall | 2m 19s | | the patch passed | | +1 :green_heart: | compile | 9m 39s | | the patch passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04 | | +1 :green_heart: | javac | 9m 39s | | the patch passed | | +1 :green_heart: | compile | 8m 35s | | the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08 | | +1 :green_heart: | javac | 8m 35s | | the patch passed | | +1 :green_heart: | blanks | 0m 0s | | The patch has no blanks issues. | | +1 :green_heart: | checkstyle | 1m 35s | | the patch passed | | +1 :green_heart: | mvnsite | 2m 56s | | the patch passed | | -1 :x: | javadoc | 0m 56s | [/patch-javadoc-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager-jdkUbuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.txt](https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4435/4/artifact/out/patch-javadoc-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager-jdkUbuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04.txt) | hadoop-yarn-server-resourcemanager in the patch failed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04. | | +1 :green_heart: | javadoc | 2m 32s | | the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08 | | +1 :green_heart: | spotbugs | 6m 18s | | the patch passed | | +1 :green_heart: | shadedclient | 22m 15s | | patch has no errors when building and testing our client artifacts. | |||| _ Other Tests _ | | +1 :green_heart: | unit | 1m 12s | | hadoop-yarn-api in the patch passed. | | +1 :green_heart: | unit | 5m 43s | | hadoop-yarn-common in the patch passed. | | -1 :x: | unit | 102m 26s | [/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txt](https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4435/4/artifact/out/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txt) | hadoop-yarn-server-resourcemanager in the patch passed. | | +1 :green_heart: | asflicense | 0m 56s | | The patch does not generate ASF License warnings. | | | | 270m 53s | | | | Reason | Tests | |-------:|:------| | Failed junit tests | hadoop.yarn.server.resourcemanager.security.TestDelegationTokenRenewer | | Subsystem | Report/Notes | |----------:|:-------------| | Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4435/4/artifact/out/Dockerfile | | GITHUB PR | https://github.com/apache/hadoop/pull/4435 | | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint | | uname | Linux f5e8a8b302d5 4.15.0-200-generic #211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | dev-support/bin/hadoop.sh | | git revision | trunk / 84d4d555f62e29fdc19947869d02ffd33b9ac4c5 | | Default Java | Private Build-1.8.0_352-8u352-ga-1~20.04-b08 | | Multi-JDK versions | /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_352-8u352-ga-1~20.04-b08 | | Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4435/4/testReport/ | | Max. process+thread count | 950 (vs. ulimit of 5500) | | modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn | | Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4435/4/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. > Avoid CPU busy idling and resource wasting in > DelegationTokenRenewerPoolTracker thread > -------------------------------------------------------------------------------------- > > Key: YARN-11178 > URL: https://issues.apache.org/jira/browse/YARN-11178 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager, security > Affects Versions: 3.3.1, 3.3.2, 3.3.3, 3.3.4 > Environment: Hadoop 3.3.3 with Kerberos, Ranger 2.1.0, Hive 2.3.7 and > Spark 3.0.3 > Reporter: Lennon Chin > Priority: Minor > Labels: pull-request-available > Attachments: YARN-11178.CPU idling busy 100% before optimized.png, > YARN-11178.CPU normal after optimized.png, YARN-11178.CPU profile for idling > busy 100% before optimized.html, YARN-11178.CPU profile for idling busy 100% > before optimized.png, YARN-11178.CPU profile for normal after optimized.html, > YARN-11178.CPU profile for normal after optimized.png > > Time Spent: 1h 40m > Remaining Estimate: 0h > > The DelegationTokenRenewerPoolTracker thread is busy wasting CPU resource in > empty poll iterate when there is no delegation token renewer event task in > the futures map: > {code:java} > // > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.DelegationTokenRenewerPoolTracker#run > @Override > public void run() { > // this while true loop is busy when the `futures` is empty > while (true) { > for (Map.Entry<DelegationTokenRenewerEvent, Future<?>> entry : futures > .entrySet()) { > DelegationTokenRenewerEvent evt = entry.getKey(); > Future<?> future = entry.getValue(); > try { > future.get(tokenRenewerThreadTimeout, TimeUnit.MILLISECONDS); > } catch (TimeoutException e) { > // Cancel thread and retry the same event in case of timeout > if (future != null && !future.isDone() && !future.isCancelled()) { > future.cancel(true); > futures.remove(evt); > if (evt.getAttempt() < tokenRenewerThreadRetryMaxAttempts) { > renewalTimer.schedule( > getTimerTask((AbstractDelegationTokenRenewerAppEvent) evt), > tokenRenewerThreadRetryInterval); > } else { > LOG.info( > "Exhausted max retry attempts {} in token renewer " > + "thread for {}", > tokenRenewerThreadRetryMaxAttempts, evt.getApplicationId()); > } > } > } catch (Exception e) { > LOG.info("Problem in submitting renew tasks in token renewer " > + "thread.", e); > } > } > } > }{code} > A better way to avoid CPU idling is waiting for some time when the `futures` > map is empty, and when the renewer task done or cancelled, we should remove > the task future in `futures` map to avoid memory leak: > {code:java} > @Override > public void run() { > while (true) { > // waiting for some time when futures map is empty > if (futures.isEmpty()) { > synchronized (this) { > try { > // waiting for tokenRenewerThreadTimeout milliseconds > long waitingTimeMs = Math.min(10000, Math.max(500, > tokenRenewerThreadTimeout)); > LOG.info("Delegation token renewer pool is empty, waiting for {} > ms.", waitingTimeMs); > wait(waitingTimeMs); > } catch (InterruptedException e) { > LOG.warn("Delegation token renewer pool tracker waiting interrupt > occurred."); > Thread.currentThread().interrupt(); > } > } > if (futures.isEmpty()) { > continue; > } > } > for (Map.Entry<DelegationTokenRenewerEvent, Future<?>> entry : futures > .entrySet()) { > DelegationTokenRenewerEvent evt = entry.getKey(); > Future<?> future = entry.getValue(); > try { > future.get(tokenRenewerThreadTimeout, TimeUnit.MILLISECONDS); > } catch (TimeoutException e) { > // Cancel thread and retry the same event in case of timeout > if (future != null && !future.isDone() && !future.isCancelled()) { > future.cancel(true); > futures.remove(evt); > if (evt.getAttempt() < tokenRenewerThreadRetryMaxAttempts) { > renewalTimer.schedule( > getTimerTask((AbstractDelegationTokenRenewerAppEvent) evt), > tokenRenewerThreadRetryInterval); > } else { > LOG.info( > "Exhausted max retry attempts {} in token renewer " > + "thread for {}", > tokenRenewerThreadRetryMaxAttempts, evt.getApplicationId()); > } > } > } catch (Exception e) { > LOG.info("Problem in submitting renew tasks in token renewer " > + "thread.", e); > } > // remove done and cancelled task > if (future.isDone() || future.isCancelled()) { > try { > futures.remove(evt); > LOG.info("Removed done or cancelled renew tasks of {} in token > renewer thread.", evt.getApplicationId()); > } catch (Exception e) { > LOG.warn("Problem in removing done or cancelled renew tasks in > token renewer thread.", e); > } > } > } > } > } {code} > -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org