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


##########
aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3V4RestSignerClient.java:
##########
@@ -70,8 +70,8 @@
   private static final Cache<Key, SignedComponent> SIGNED_COMPONENT_CACHE =
       Caffeine.newBuilder().expireAfterWrite(30, 
TimeUnit.SECONDS).maximumSize(100).build();
 
-  private static final ScheduledExecutorService TOKEN_REFRESH_EXECUTOR =
-      ThreadPools.newScheduledPool("s3-signer-token-refresh", 1);
+  private static final AtomicReference<ScheduledExecutorService> 
TOKEN_REFRESH_EXECUTOR =

Review Comment:
   @jackye1995 I gave it some additional thought and I think using 
double-checked locking is probably better for now to align with other places in 
the codebase.
   
   If we'd want to replace double-checked locking in the codebase in the 
future, we might want to consider a variation of an `AtomicInitializer` that 
guarantees that the object to be constructed is initialized exactly once 
(similar to 
https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/concurrent/AtomicSafeInitializer.java#L54)



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