YARN-10726. Log the size of DelegationTokenRenewer event queue in case of too many pending events. Contributed by Qi Zhu.

This commit is contained in:
Peter Bacsko 2021-04-01 16:09:52 +02:00
parent 9f1655baf2
commit 158758c5bf
1 changed files with 9 additions and 0 deletions

View File

@ -89,6 +89,8 @@ public class DelegationTokenRenewer extends AbstractService {
new Text("HDFS_DELEGATION_TOKEN"); new Text("HDFS_DELEGATION_TOKEN");
public static final String SCHEME = "hdfs"; public static final String SCHEME = "hdfs";
private volatile int lastEventQueueSizeLogged = 0;
// global single timer (daemon) // global single timer (daemon)
private Timer renewalTimer; private Timer renewalTimer;
private RMContext rmContext; private RMContext rmContext;
@ -228,6 +230,13 @@ public class DelegationTokenRenewer extends AbstractService {
futures.put(evt, future); futures.put(evt, future);
} else { } else {
pendingEventQueue.add(evt); pendingEventQueue.add(evt);
int qSize = pendingEventQueue.size();
if (qSize != 0 && qSize % 1000 == 0
&& lastEventQueueSizeLogged != qSize) {
lastEventQueueSizeLogged = qSize;
LOG.info("Size of pending " +
"DelegationTokenRenewerEvent queue is " + qSize);
}
} }
} finally { } finally {
serviceStateLock.readLock().unlock(); serviceStateLock.readLock().unlock();