danielcweeks commented on code in PR #18378:
URL: https://github.com/apache/iceberg/pull/18378#discussion_r4200581575
##########
core/src/main/java/org/apache/iceberg/rest/auth/AuthSessionCache.java:
##########
@@ -37,6 +38,17 @@ public class AuthSessionCache implements AutoCloseable {
private static final Logger LOG =
LoggerFactory.getLogger(AuthSessionCache.class);
+ /**
+ * A single daemon thread, shared by all cache instances for eviction tasks.
A shared executor
+ * avoids registering one JVM shutdown hook per cache instance: each hook
thread is constructed
+ * on the creating thread and would otherwise copy that thread's inheritable
thread-locals,
+ * pinning state such as closed Spark sessions for the life of the JVM. The
worker thread is
+ * created with inheritable thread-local variables disabled so it cannot pin
the creating
+ * thread's state either. The executor is deliberately exposed only as a
plain {@link Executor}
+ * (never an {@link ExecutorService}) so that {@link #close()} does not shut
it down.
+ */
+ private static final Executor SHARED_EVICTION_EXECUTOR =
newSharedEvictionExecutor();
Review Comment:
Can't we just assign from `ThreadPools.newExitingWorkerPool(...)`? Why are
we re-implementing creating a worker pool when we have static methods to do
that already?
--
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]