Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1017,12 +1017,26 @@ public void run() {
"Exhausted max retry attempts {} in token renewer "
+ "thread for {}",
tokenRenewerThreadRetryMaxAttempts, evt.getApplicationId());
continue;
}
}
} catch (Exception e) {
LOG.info("Problem in submitting renew tasks in token renewer "
+ "thread.", e);
continue;
}

// For normally finished DT renew event, it should be removed from futures.
futures.remove(evt);
}

// If the cluster is idle for some time, futures map is empty or no event handler found which may still cause high CPU utilization
// Therefore a short nap should be added here.
try {
Thread.sleep(1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set sleep 1000ms, what is the effect of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set sleep 1000ms, what is the effect of this?

Give up CPU

Copy link
Contributor

@slfan1989 slfan1989 Dec 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we give data? The CPU ratio before and after the modification. Why did we choose 1000ms? there seems to be no data support for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slfan1989
Thanks for review.
The CPU utilization statistics is as follows:
Before optimize:
image

After optimize:
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to be a good way to deal with it through thread sleep.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not convinced with the sleep either as @slfan1989 mentioned and it looks very arbitrary to me, worked for you but might cause issues for others

} catch (InterruptedException ex) {
// No big deal, just ignore this exception here and try the next round
LOG.warn("DelegationTokenRenewerePoolTracker idle sleep is interrupted.");
}
}
}
Expand Down