Savonitar commented on code in PR #28639:
URL: https://github.com/apache/flink/pull/28639#discussion_r4064149574
##########
flink-runtime/src/main/java/org/apache/flink/runtime/security/token/DefaultDelegationTokenManager.java:
##########
@@ -92,6 +101,22 @@ public class DefaultDelegationTokenManager implements
DelegationTokenManager {
@VisibleForTesting long lastKnownNextRenewal = Long.MAX_VALUE;
+ private final long reobtainCooldownMillis;
+
+ /**
+ * Clock used for renewal and cooldown timing. Renewal math reads absolute
time (a token's
+ * validUntil is an absolute epoch), while scheduling and the cooldown
read relative time, which
+ * wall-clock adjustments cannot distort. Never mix the two in one
expression.
+ */
+ private final Clock clock;
+
+ /**
+ * Serializes the obtain-and-broadcast cycle so that, even though {@code
cancel(true)} does not
+ * wait for an in-flight cycle and the IO executor is multi-threaded, two
cycles can never run
+ * concurrently and broadcast tokens out of order.
+ */
+ private final Object obtainLock = new Object();
Review Comment:
Renamed as suggested in 040b17867b5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]