[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer causes RM crash during failover
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16498637#comment-16498637 ] Hudson commented on YARN-7962: -- SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #14338 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/14338/]) YARN-7962. Race Condition When Stopping DelegationTokenRenewer causes RM (wangda: rev 931f78718f3a09775bfa1f9a952c069c416d0914) * (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestDelegationTokenRenewer.java * (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java > Race Condition When Stopping DelegationTokenRenewer causes RM crash during > failover > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Assignee: BELUGA BEHR >Priority: Critical > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch, YARN-7962.6.patch, YARN-7962.7.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16498276#comment-16498276 ] Billie Rinaldi commented on YARN-7962: -- Sounds good to me. Thanks, [~leftnoteasy]! > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Critical > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch, YARN-7962.6.patch, YARN-7962.7.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16498246#comment-16498246 ] Wangda Tan commented on YARN-7962: -- Thanks [~billie.rinaldi], to me, differences between ver.6 and ver.7 patch is minimum. Since the isServiceStarted is volatile, both patches are safe. +1 to the ver.7 patch, will commit today if no objections. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Critical > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch, YARN-7962.6.patch, YARN-7962.7.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16498149#comment-16498149 ] genericqa commented on YARN-7962: - | (/) *{color:green}+1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 31s{color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s{color} | {color:green} The patch appears to include 1 new or modified test files. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 23m 26s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 39s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 35s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 43s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 10m 30s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 7s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 27s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 40s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 34s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 34s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 29s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 39s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 10m 30s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 11s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 24s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} unit {color} | {color:green} 68m 41s{color} | {color:green} hadoop-yarn-server-resourcemanager in the patch passed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 25s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black}121m 15s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:abb62dd | | JIRA Issue | YARN-7962 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12926095/YARN-7962.7.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux 856761d5c2b1 4.4.0-89-generic #112-Ubuntu SMP Mon Jul 31 19:38:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / 6b21a59 | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_162 | | findbugs | v3.1.0-RC1 | | Test Results | https://builds.apache.org/job/PreCommit-YARN-Build/20921/testReport/ | | Max. process+thread count | 869 (vs. ulimit of 1) | | modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager | | Console output | https://builds.apache.org/job/PreCommit-YARN-Build/20921/console | | Powered by | Apache Yetus 0.8.0-SNAPSHOT http://yetus.apache.org | This message was automatically generated. > Race Condition When Stopping DelegationTokenRenewer
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16498013#comment-16498013 ] Billie Rinaldi commented on YARN-7962: -- Patch 7 is the same as patch 3 without the serviceStart changes. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Critical > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch, YARN-7962.6.patch, YARN-7962.7.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16498004#comment-16498004 ] Billie Rinaldi commented on YARN-7962: -- Ah, I see what Wilfred is saying now. I don't think the locking is done correctly in patch 6. I think Wangda is right that isServiceStarted = false and renewerService.shutdown() both need to be performed while the lock is held in serviceStop, and Wilfred is right that the locking in serviceStart should not be changed. ThreadPoolExecutor.shutdown says that previously submitted tasks are executed, but it still seems like it would be safer to include the shutdown in the lock. I'll attach patch 7 with my proposed changes. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Critical > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch, YARN-7962.6.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16497368#comment-16497368 ] Wangda Tan commented on YARN-7962: -- The failed tests happened in other JIRAs as well: https://builds.apache.org/job/PreCommit-YARN-Build/20853/testReport/ If everybody agrees, I will commit the patch by tomorrow. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Critical > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch, YARN-7962.6.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16497190#comment-16497190 ] genericqa commented on YARN-7962: - | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 21s{color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s{color} | {color:green} The patch appears to include 1 new or modified test files. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 27m 51s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 44s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 39s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 47s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 12m 13s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 14s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 28s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 44s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 40s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 40s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 33s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 46s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 12m 17s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 23s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 25s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:red}-1{color} | {color:red} unit {color} | {color:red} 70m 33s{color} | {color:red} hadoop-yarn-server-resourcemanager in the patch failed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 26s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black}131m 52s{color} | {color:black} {color} | \\ \\ || Reason || Tests || | Failed junit tests | hadoop.yarn.server.resourcemanager.applicationsmanager.TestAMRestart | \\ \\ || Subsystem || Report/Notes || | Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:abb62dd | | JIRA Issue | YARN-7962 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12925963/YARN-7962.6.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux 85663cc4551f 3.13.0-143-generic #192-Ubuntu SMP Tue Feb 27 10:45:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / a58acd9 | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_162 | | findbugs | v3.1.0-RC1 | | unit | https://builds.apache.org/job/PreCommit-YARN-Build/20914/artifact/out/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txt | | Test Results | https://builds.apache.org/job/PreCommit-YARN-Build/20914/testReport/ | | Max. process+thread count | 847 (vs. ulimit of 1) | | modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U:
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16497022#comment-16497022 ] Wangda Tan commented on YARN-7962: -- The attached patch looks good, +1. Thanks [~belugabehr]. I did some minor rebase to apply it on top of trunk. [~wilfreds], for your last comment, I'm not sure if I fully understand. I think we want to make sure the event processing {{renewerService.execute(new DelegationTokenRenewerRunnable(evt));}} Will not be rejected by a shutdown call. If we remove the shutdown out of lock, it is possible that thread B shutdown the executor while A is inside {{execute}}. Please let me know if I misunderstood this. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch, YARN-7962.6.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447673#comment-16447673 ] Wilfred Spiegelenburg commented on YARN-7962: - Sorry for the delay was caught up in other things: Try/Finally might be recommended but I really do not see why we would do it in this case: we only need to set a boolean to true or false within the lock. Anything else would change the flow completely. We should not process the events or shut down the service within the lock. We really only want to set the boolean within the lock and don't do anything else. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16441037#comment-16441037 ] BELUGA BEHR commented on YARN-7962: --- [~billie.rinaldi] [~wilfreds] Any additional concerns? Please commit. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16430677#comment-16430677 ] Billie Rinaldi commented on YARN-7962: -- [~wilfreds], any further comments about patch 3, given that try/finally is the recommended best practice? > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16425525#comment-16425525 ] BELUGA BEHR commented on YARN-7962: --- [~wilfreds] {{try...finally}} is a best practice. bq. It is recommended practice to always immediately follow a call to lock with a try block, most typically in a before/after construction https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantLock.html Please consider patch version 3 for inclusion into the project. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16425515#comment-16425515 ] Wilfred Spiegelenburg commented on YARN-7962: - Sorry I made a typo in my comment [~belugabehr]: the locking is correct and should stay. The comment should have been about the {{try...finally}} that you introduced. * Locking should stay in the serviceStart method (no change needed in that method at all) * Locking should be added in the serviceStop method around the state change like this: {code} serviceStateLock.writeLock().lock(); isServiceStarted = true; serviceStateLock.writeLock().unlock(); {code} * Neither methods should have a {{try...finally}} Sorry for that > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch, > YARN-7962.4.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16424795#comment-16424795 ] genericqa commented on YARN-7962: - | (/) *{color:green}+1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 18s{color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s{color} | {color:green} The patch appears to include 1 new or modified test files. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 25m 0s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 41s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 34s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 42s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 11m 6s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 6s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 25s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 41s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 36s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 36s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 30s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 39s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 11m 7s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 14s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 23s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} unit {color} | {color:green} 64m 52s{color} | {color:green} hadoop-yarn-server-resourcemanager in the patch passed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 21s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black}119m 56s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:8620d2b | | JIRA Issue | YARN-7962 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12917449/YARN-7962.4.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux 11366ec05406 3.13.0-137-generic #186-Ubuntu SMP Mon Dec 4 19:09:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / 2d06d88 | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_162 | | findbugs | v3.1.0-RC1 | | Test Results | https://builds.apache.org/job/PreCommit-YARN-Build/20209/testReport/ | | Max. process+thread count | 885 (vs. ulimit of 1) | | modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager | | Console output | https://builds.apache.org/job/PreCommit-YARN-Build/20209/console | | Powered by | Apache Yetus 0.8.0-SNAPSHOT http://yetus.apache.org | This message was automatically generated. > Race Condition When Stopping DelegationTokenRenewer
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16421096#comment-16421096 ] Wilfred Spiegelenburg commented on YARN-7962: - Thank you [~belugabehr] patch is looking better now. I still do not see why the first part of the change is needed: there is no need for locking around the cleanup of the {{pendingEventQueue}}. We do not have it currently and there is nothing that could throw. Setting the {{isServiceStarted}} on shutdown should be within the lock but it can not throw, neither can the shutdown, so I don't see why we would use the try..finally in the change at that point either. It does not provide anything extra. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16419830#comment-16419830 ] BELUGA BEHR commented on YARN-7962: --- [~billie.rinaldi] Thank you for the assist! I have been on vacation now for a little bit and have been unable to work on this. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch, YARN-7962.2.patch, YARN-7962.3.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16416860#comment-16416860 ] genericqa commented on YARN-7962: - | (/) *{color:green}+1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 17s{color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s{color} | {color:green} The patch appears to include 1 new or modified test files. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 26m 45s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 40s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 35s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 44s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 11m 22s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 8s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 26s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 43s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 36s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 36s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 31s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 40s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 11m 33s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 13s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 24s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} unit {color} | {color:green} 67m 20s{color} | {color:green} hadoop-yarn-server-resourcemanager in the patch passed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 21s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black}124m 58s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:8620d2b | | JIRA Issue | YARN-7962 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12916526/YARN-7962.3.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux 2e13a5f026a9 3.13.0-139-generic #188-Ubuntu SMP Tue Jan 9 14:43:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / a71656c | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_151 | | findbugs | v3.1.0-RC1 | | Test Results | https://builds.apache.org/job/PreCommit-YARN-Build/20115/testReport/ | | Max. process+thread count | 807 (vs. ulimit of 1) | | modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager | | Console output | https://builds.apache.org/job/PreCommit-YARN-Build/20115/console | | Powered by | Apache Yetus 0.8.0-SNAPSHOT http://yetus.apache.org | This message was automatically generated. > Race Condition When Stopping DelegationTokenRenewer
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406375#comment-16406375 ] Billie Rinaldi commented on YARN-7962: -- Hi [~belugabehr], thanks for working on this patch. The patch looks pretty good, but the unit test is failing because RMContext hasn't been set. You could use the createNewDelegationTokenRenewer method in TestDelegationTokenRenewer, or you could use that as a model for how to initialize the RMContext. Please also address the minor checkstyle issues in the test. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch, YARN-7962.2.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403559#comment-16403559 ] genericqa commented on YARN-7962: - | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 28s{color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s{color} | {color:green} The patch appears to include 1 new or modified test files. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 15m 30s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 37s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 33s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 41s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 10m 25s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 2s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 25s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 39s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 35s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 35s{color} | {color:green} the patch passed {color} | | {color:orange}-0{color} | {color:orange} checkstyle {color} | {color:orange} 0m 29s{color} | {color:orange} hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager: The patch generated 3 new + 101 unchanged - 0 fixed = 104 total (was 101) {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 36s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 10m 16s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 8s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 23s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:red}-1{color} | {color:red} unit {color} | {color:red} 67m 56s{color} | {color:red} hadoop-yarn-server-resourcemanager in the patch failed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 16s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black}111m 46s{color} | {color:black} {color} | \\ \\ || Reason || Tests || | Failed junit tests | hadoop.yarn.server.resourcemanager.security.TestDelegationTokenRenewer | \\ \\ || Subsystem || Report/Notes || | Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:d4cc50f | | JIRA Issue | YARN-7962 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12915010/YARN-7962.2.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux 231112c96e87 4.4.0-89-generic #112-Ubuntu SMP Mon Jul 31 19:38:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / 49c747a | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_151 | | findbugs | v3.1.0-RC1 | | checkstyle | https://builds.apache.org/job/PreCommit-YARN-Build/20001/artifact/out/diff-checkstyle-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txt | | unit |
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403069#comment-16403069 ] Wilfred Spiegelenburg commented on YARN-7962: - I don't think this is a really a race condition that you need to test. Currently when we stop the service we do not set the flag {{isServiceStarted}}. So in a unit test I would just call the {{serviceStop}} and then call the {{applicationFinished}} from the same thread. Since the flag is not set I would expect that to fail without the fix and pass with the fix. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16402242#comment-16402242 ] BELUGA BEHR commented on YARN-7962: --- [~wilfreds] Can you please provide thoughts on how to unit test a race condition of this sort? How to introduce pauses into the locked code? Also, there technically isn't a need to lock on the initialization. It's just a safety and good practice item. There will be almost no overheard since we will only initialize one time (or maybe a couple) of times, so it doesn't hurt to be safe. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16401513#comment-16401513 ] Wilfred Spiegelenburg commented on YARN-7962: - [~belugabehr] Thank you for logging this issue. When I look at the change I do not understand why we would need the first part of the change. The {{pendingEventQueue}} is only used inside the {{processDelegationTokenRenewerEvent}} inside the lock. After we change the state of the service we stop writing into the queue and directly go and process them. The second part of the change looks good to. Can you please write a junit test for this? > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16377552#comment-16377552 ] BELUGA BEHR commented on YARN-7962: --- Unit test failures appear to be unrelated. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16375133#comment-16375133 ] genericqa commented on YARN-7962: - | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 37s{color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | | {color:red}-1{color} | {color:red} test4tests {color} | {color:red} 0m 0s{color} | {color:red} 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. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 15m 47s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 37s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 24s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 37s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 9m 38s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 2s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 23s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 41s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 34s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 34s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 22s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 37s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 9m 46s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 4s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 22s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:red}-1{color} | {color:red} unit {color} | {color:red} 77m 53s{color} | {color:red} hadoop-yarn-server-resourcemanager in the patch failed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 19s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black}120m 31s{color} | {color:black} {color} | \\ \\ || Reason || Tests || | Failed junit tests | hadoop.yarn.server.resourcemanager.TestRMEmbeddedElector | | | hadoop.yarn.server.resourcemanager.reservation.TestCapacityOverTimePolicy | \\ \\ || Subsystem || Report/Notes || | Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:5b98639 | | JIRA Issue | YARN-7962 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12911807/YARN-7962.1.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux b809dea20cc0 4.4.0-89-generic #112-Ubuntu SMP Mon Jul 31 19:38:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / 51088d3 | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_151 | | findbugs | v3.1.0-RC1 | | unit | https://builds.apache.org/job/PreCommit-YARN-Build/19799/artifact/out/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txt | | Test Results | https://builds.apache.org/job/PreCommit-YARN-Build/19799/testReport/ | | Max.
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16374999#comment-16374999 ] BELUGA BEHR commented on YARN-7962: --- Also tighten things up a little (make start and stop symmetrical) when it comes to blocking. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > Attachments: YARN-7962.1.patch > > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org
[jira] [Commented] (YARN-7962) Race Condition When Stopping DelegationTokenRenewer
[ https://issues.apache.org/jira/browse/YARN-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16373587#comment-16373587 ] BELUGA BEHR commented on YARN-7962: --- {quote}pool size = 0, active threads = 0, queued tasks = 0{quote} Pool size is 0 because the pool was shut down is my guess. > Race Condition When Stopping DelegationTokenRenewer > --- > > Key: YARN-7962 > URL: https://issues.apache.org/jira/browse/YARN-7962 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager >Affects Versions: 3.0.0 >Reporter: BELUGA BEHR >Priority: Minor > > [https://github.com/apache/hadoop/blob/69fa81679f59378fd19a2c65db8019393d7c05a2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java] > {code:java} > private ThreadPoolExecutor renewerService; > private void processDelegationTokenRenewerEvent( > DelegationTokenRenewerEvent evt) { > serviceStateLock.readLock().lock(); > try { > if (isServiceStarted) { > renewerService.execute(new DelegationTokenRenewerRunnable(evt)); > } else { > pendingEventQueue.add(evt); > } > } finally { > serviceStateLock.readLock().unlock(); > } > } > @Override > protected void serviceStop() { > if (renewalTimer != null) { > renewalTimer.cancel(); > } > appTokens.clear(); > allTokens.clear(); > this.renewerService.shutdown(); > {code} > {code:java} > 2018-02-21 11:18:16,253 FATAL org.apache.hadoop.yarn.event.AsyncDispatcher: > Error in dispatcher thread > java.util.concurrent.RejectedExecutionException: Task > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer$DelegationTokenRenewerRunnable@39bddaf2 > rejected from java.util.concurrent.ThreadPoolExecutor@5f71637b[Terminated, > pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 15487] > at > java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) > at > java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) > at > java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.processDelegationTokenRenewerEvent(DelegationTokenRenewer.java:196) > at > org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer.applicationFinished(DelegationTokenRenewer.java:734) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.finishApplication(RMAppManager.java:199) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:424) > at > org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.handle(RMAppManager.java:65) > at > org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:177) > at > org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:109) > at java.lang.Thread.run(Thread.java:745) > {code} > What I think is going on here is that the {{serviceStop}} method is not > setting the {{isServiceStarted}} flag to 'false'. > Please update so that the {{serviceStop}} method grabs the > {{serviceStateLock}} and sets {{isServiceStarted}} to _false_, before > shutting down the {{renewerService}} thread pool, to avoid this condition. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org