nastra commented on code in PR #6562:
URL: https://github.com/apache/iceberg/pull/6562#discussion_r1085759541


##########
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:
   good catch, that makes sense. I've pushed a fix where we reset the original 
`expiresAtMillis` when the token refresh failed



-- 
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]

Reply via email to