fluss icon indicating copy to clipboard operation
fluss copied to clipboard

[client] Prevent invalid security-token renewal scheduling

Open pbanakar opened this issue 1 month ago • 0 comments

Search before asking

  • [x] I searched in the issues and found nothing similar.

Fluss version

main (development)

Please describe the bug 🐞

DefaultSecurityTokenManager calculates the security-token renewal delay using the configured renewal ratio and the token renewal timestamp:

Math.round(tokensRenewalTimeRatio * (nextRenewal - now))

When the token is already expired or the client clock is ahead of the token timestamp, the calculated delay can be zero or negative. Since the next token renewal may also produce the same result, the client can repeatedly contact the coordinator in a tight loop. Expected behavior: •A non-positive renewal delay should use the configured security-token renewal retry backoff. •A warning should be logged to indicate possible clock skew. •Existing behavior for tokens without an expiry timestamp should remain unchanged. These tokens are produced by the local filesystem and HDFS implementations and are valid indefinitely. •Existing retry behavior for token acquisition failures should remain unchanged.

Solution

When the calculated renewal delay is zero or negative, use the configured security-token renewal retry backoff instead of scheduling the next renewal immediately. Log a warning indicating that the condition may be caused by clock skew.

Add focused regression coverage for:

  1. A normal future renewal timestamp.
  2. A zero calculated renewal delay.
  3. A negative calculated renewal delay.

No public API or protocol changes are expected.

No public API or protocol changes are expected.

This issue is part of #4980.

Are you willing to submit a PR?

  • [x] I'm willing to submit a PR!

pbanakar avatar Nov 02 '26 18:11 pbanakar