rdblue commented on code in PR #6562:
URL: https://github.com/apache/iceberg/pull/6562#discussion_r1085735299
##########
core/src/main/java/org/apache/iceberg/rest/auth/OAuth2Util.java:
##########
@@ -585,22 +547,24 @@ public static AuthSession fromAccessToken(
long startTimeMillis = System.currentTimeMillis();
Long expiresAtMillis = session.expiresAtMillis();
- if (isExpired(expiresAtMillis, startTimeMillis)) {
+ if (null != expiresAtMillis && expiresAtMillis <= startTimeMillis) {
Pair<Integer, TimeUnit> expiration = session.refresh(client);
+ // if expiration is non-null, then token refresh was successful
Review Comment:
I think we need an else case that avoids scheduling token refresh. If the
expiration is null then the refresh was not successful and should not be
reattempted. But in that case, `expiresAtMillis` has the original expired value
and will cause the last check to schedule a token refresh.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]