You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kfaraz (via GitHub)" <gi...@apache.org> on 2025/05/30 07:55:03 UTC

[PR] Shutdown basic auth cache manager immediately (druid)

kfaraz opened a new pull request, #18052:
URL: https://github.com/apache/druid/pull/18052

   ### Bug
   
   When a peon is being shutdown, `CoordinatorPollingBasicAuthorizerCacheManager.stop()` is invoked.
   But this doesn't interrupt currently executing poll.
   If at this point, the Coordinator happens to be unreachable, the peon gets stuck in retries and might eventually fail.
   
   <details>
   <summary>Sample logs:</summary>
   
   ```json
   2025-05-30T06:32:49,366 INFO [main] org.apache.druid.security.basic.authentication.db.cache.CoordinatorPollingBasicAuthenticatorCacheManager - CoordinatorPollingBasicAuthenticatorCacheManager is stopping.
   2025-05-30T06:32:49,367 INFO [main] org.apache.druid.security.basic.authentication.db.cache.CoordinatorPollingBasicAuthenticatorCacheManager - CoordinatorPollingBasicAuthenticatorCacheManager is stopped.
   2025-05-30T06:32:49,378 INFO [main] org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager - CoordinatorPollingBasicAuthorizerCacheManager is stopping.
   2025-05-30T06:32:49,378 INFO [main] org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager - CoordinatorPollingBasicAuthorizerCacheManager is stopped.
   2025-05-30T06:32:49,378 INFO [main] io.imply.druid.security.keycloak.cache.PollingCacheManager - PollingCacheManager for keycloak is stopping.
   2025-05-30T06:32:49,378 INFO [main] io.imply.druid.security.keycloak.cache.PollingCacheManager - PollingCacheManager for keycloak is stopped.
   2025-05-30T06:32:49,380 INFO [LookupExtractorFactoryContainerProvider-MainThread] org.apache.druid.query.lookup.LookupReferencesManager - Lookup Management loop exited. Lookup notices are not handled anymore.
   2025-05-30T06:32:49,382 INFO [Curator-Framework-0] org.apache.curator.framework.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting
   2025-05-30T06:32:49,486 ERROR [main-EventThread] org.apache.curator.framework.imps.CuratorFrameworkImpl - Background exception was not retry-able or retry gave up
   java.lang.IllegalStateException: Client is not started
   	at org.apache.curator.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:502) ~[curator-client-5.5.0.jar:5.5.0]
   	at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:139) ~[curator-client-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.getZooKeeper(CuratorFrameworkImpl.java:649) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.RemoveWatchesBuilderImpl.performBackgroundOperation(RemoveWatchesBuilderImpl.java:337) ~[curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.OperationAndData.callPerformBackgroundOperation(OperationAndData.java:84) ~[curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.performBackgroundOperation(CuratorFrameworkImpl.java:1008) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:667) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.RemoveWatchesBuilderImpl.pathInBackground(RemoveWatchesBuilderImpl.java:229) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.RemoveWatchesBuilderImpl.internalRemoval(RemoveWatchesBuilderImpl.java:84) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.WatcherRemovalManager.removeWatchers(WatcherRemovalManager.java:67) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.WatcherRemovalFacade.removeWatchers(WatcherRemovalFacade.java:68) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.recipes.cache.PathChildrenCache.reRemoveWatchersOnBackgroundClosed(PathChildrenCache.java:614) [curator-recipes-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.recipes.cache.PathChildrenCache.access$100(PathChildrenCache.java:72) [curator-recipes-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.recipes.cache.PathChildrenCache$4.processResult(PathChildrenCache.java:502) [curator-recipes-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(CuratorFrameworkImpl.java:926) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:683) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.WatcherRemovalFacade.processBackgroundOperation(WatcherRemovalFacade.java:152) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.GetChildrenBuilderImpl$2.processResult(GetChildrenBuilderImpl.java:188) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:667) [zookeeper-3.8.4.jar:3.8.4]
   	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:554) [zookeeper-3.8.4.jar:3.8.4]
   2025-05-30T06:32:49,683 ERROR [main-EventThread] org.apache.curator.framework.imps.CuratorFrameworkImpl - Background exception was not retry-able or retry gave up
   java.lang.IllegalStateException: Client is not started
   	at org.apache.curator.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:502) ~[curator-client-5.5.0.jar:5.5.0]
   	at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:139) ~[curator-client-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.getZooKeeper(CuratorFrameworkImpl.java:649) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.RemoveWatchesBuilderImpl.performBackgroundOperation(RemoveWatchesBuilderImpl.java:337) ~[curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.OperationAndData.callPerformBackgroundOperation(OperationAndData.java:84) ~[curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.performBackgroundOperation(CuratorFrameworkImpl.java:1008) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:667) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.RemoveWatchesBuilderImpl.pathInBackground(RemoveWatchesBuilderImpl.java:229) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.RemoveWatchesBuilderImpl.internalRemoval(RemoveWatchesBuilderImpl.java:84) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.WatcherRemovalManager.removeWatchers(WatcherRemovalManager.java:67) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.WatcherRemovalFacade.removeWatchers(WatcherRemovalFacade.java:68) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.recipes.cache.PathChildrenCache.reRemoveWatchersOnBackgroundClosed(PathChildrenCache.java:614) [curator-recipes-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.recipes.cache.PathChildrenCache.access$100(PathChildrenCache.java:72) [curator-recipes-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.recipes.cache.PathChildrenCache$4.processResult(PathChildrenCache.java:502) [curator-recipes-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(CuratorFrameworkImpl.java:926) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:683) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.WatcherRemovalFacade.processBackgroundOperation(WatcherRemovalFacade.java:152) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.curator.framework.imps.GetChildrenBuilderImpl$2.processResult(GetChildrenBuilderImpl.java:188) [curator-framework-5.5.0.jar:5.5.0]
   	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:667) [zookeeper-3.8.4.jar:3.8.4]
   	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:554) [zookeeper-3.8.4.jar:3.8.4]
   2025-05-30T06:33:04,528 WARN [CoordinatorPollingBasicAuthorizerCacheManager-Exec--0] org.apache.druid.java.util.common.RetryUtils - Retrying (1 of 9) in 1,216ms.
   java.lang.IllegalStateException: null
   	at com.google.common.base.Preconditions.checkState(Preconditions.java:496) ~[guava-32.0.1-jre.jar:?]
   	at org.apache.druid.discovery.DruidLeaderClient.makeRequest(DruidLeaderClient.java:119) ~[druid-server-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.tryFetchGroupMappingMapsFromCoordinator(CoordinatorPollingBasicAuthorizerCacheManager.java:414) ~[?:?]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.lambda$fetchGroupAndRoleMapFromCoordinator$6(CoordinatorPollingBasicAuthorizerCacheManager.java:361) ~[?:?]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:129) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:81) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:163) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:153) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.fetchGroupAndRoleMapFromCoordinator(CoordinatorPollingBasicAuthorizerCacheManager.java:359) ~[?:?]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.lambda$start$1(CoordinatorPollingBasicAuthorizerCacheManager.java:156) ~[?:?]
   	at org.apache.druid.java.util.common.concurrent.ScheduledExecutors$1.call(ScheduledExecutors.java:55) [druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.concurrent.ScheduledExecutors$1.call(ScheduledExecutors.java:51) [druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.concurrent.ScheduledExecutors$2.run(ScheduledExecutors.java:87) [druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
   	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
   	at java.base/java.lang.Thread.run(Thread.java:840) [?:?]
   2025-05-30T06:33:05,746 WARN [CoordinatorPollingBasicAuthorizerCacheManager-Exec--0] org.apache.druid.java.util.common.RetryUtils - Retrying (2 of 9) in 1,630ms.
   java.lang.IllegalStateException: null
   	at com.google.common.base.Preconditions.checkState(Preconditions.java:496) ~[guava-32.0.1-jre.jar:?]
   	at org.apache.druid.discovery.DruidLeaderClient.makeRequest(DruidLeaderClient.java:119) ~[druid-server-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.tryFetchGroupMappingMapsFromCoordinator(CoordinatorPollingBasicAuthorizerCacheManager.java:414) ~[?:?]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.lambda$fetchGroupAndRoleMapFromCoordinator$6(CoordinatorPollingBasicAuthorizerCacheManager.java:361) ~[?:?]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:129) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:81) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:163) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:153) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.fetchGroupAndRoleMapFromCoordinator(CoordinatorPollingBasicAuthorizerCacheManager.java:359) ~[?:?]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.lambda$start$1(CoordinatorPollingBasicAuthorizerCacheManager.java:156) ~[?:?]
   	at org.apache.druid.java.util.common.concurrent.ScheduledExecutors$1.call(ScheduledExecutors.java:55) [druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.concurrent.ScheduledExecutors$1.call(ScheduledExecutors.java:51) [druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.concurrent.ScheduledExecutors$2.run(ScheduledExecutors.java:87) [druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
   	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
   	at java.base/java.lang.Thread.run(Thread.java:840) [?:?]
   2025-05-30T06:33:07,377 WARN [CoordinatorPollingBasicAuthorizerCacheManager-Exec--0] org.apache.druid.java.util.common.RetryUtils - Retrying (3 of 9) in 2,069ms.
   java.lang.IllegalStateException: null
   	at com.google.common.base.Preconditions.checkState(Preconditions.java:496) ~[guava-32.0.1-jre.jar:?]
   	at org.apache.druid.discovery.DruidLeaderClient.makeRequest(DruidLeaderClient.java:119) ~[druid-server-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.tryFetchGroupMappingMapsFromCoordinator(CoordinatorPollingBasicAuthorizerCacheManager.java:414) ~[?:?]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.lambda$fetchGroupAndRoleMapFromCoordinator$6(CoordinatorPollingBasicAuthorizerCacheManager.java:361) ~[?:?]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:129) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:81) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:163) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:153) ~[druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.fetchGroupAndRoleMapFromCoordinator(CoordinatorPollingBasicAuthorizerCacheManager.java:359) ~[?:?]
   	at org.apache.druid.security.basic.authorization.db.cache.CoordinatorPollingBasicAuthorizerCacheManager.lambda$start$1(CoordinatorPollingBasicAuthorizerCacheManager.java:156) ~[?:?]
   	at org.apache.druid.java.util.common.concurrent.ScheduledExecutors$1.call(ScheduledExecutors.java:55) [druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.concurrent.ScheduledExecutors$1.call(ScheduledExecutors.java:51) [druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at org.apache.druid.java.util.common.concurrent.ScheduledExecutors$2.run(ScheduledExecutors.java:87) [druid-processing-2025.04.0-iap.jar:2025.04.0-iap]
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
   	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
   	at java.base/java.lang.Thread.run(Thread.java:840) [?:?]
   ```
   </details>
   
   ### Fix
   
   - Use `shutdownNow` instead of `shutdown` in `CoordinatorPollingBasicAuthorizerCacheManager.stop()`
   
   <hr>
   
   This PR has:
   
   - [ ] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Stop basic auth cache manager immediately on service shutdown (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #18052:
URL: https://github.com/apache/druid/pull/18052#issuecomment-2962995479

   Thanks for the review, @capistrant !


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Stop basic auth cache manager immediately on service shutdown (druid)

Posted by "gianm (via GitHub)" <gi...@apache.org>.
gianm commented on code in PR #18052:
URL: https://github.com/apache/druid/pull/18052#discussion_r2116893154


##########
extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:
##########
@@ -126,6 +126,9 @@ public void start()
               }
               LOG.debug("Scheduled user cache poll is done");
             }
+            catch (InterruptedException e) {
+              LOG.noStackTrace().warn(e, "Interrupted while polling Coordinator for cachedUserMaps.");

Review Comment:
   Generally, I like omitting the stack trace for `InterruptedException`, since it generally happens when a service is being shut down. It's annoying for a service to log a ton of stack traces when shutting down.
   
   Actually, I would also drop this (& other log messages about interruption) to `INFO` rather than `WARN`. Interruption here is expected behavior during a shutdown, nothing bad is happening, so it shouldn't warn.



##########
extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:
##########
@@ -126,6 +126,9 @@ public void start()
               }
               LOG.debug("Scheduled user cache poll is done");
             }
+            catch (InterruptedException e) {
+              LOG.noStackTrace().warn(e, "Interrupted while polling Coordinator for cachedUserMaps.");

Review Comment:
   Generally, I like omitting the stack trace for `InterruptedException`, since it generally happens when a service is being shut down. It's annoying for a service to log a ton of stack traces when shutting down.
   
   Actually, I would also drop this (& other log messages about interruption) to `INFO` rather than `WARN`. Interruption is expected behavior during a shutdown, nothing bad is happening, so it shouldn't warn.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Stop basic auth cache manager immediately on service shutdown (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #18052:
URL: https://github.com/apache/druid/pull/18052#discussion_r2117381889


##########
extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:
##########
@@ -126,6 +126,9 @@ public void start()
               }
               LOG.debug("Scheduled user cache poll is done");
             }
+            catch (InterruptedException e) {
+              LOG.noStackTrace().warn(e, "Interrupted while polling Coordinator for cachedUserMaps.");

Review Comment:
   Thanks for the clarification, @gianm .
   
   I have update the code accordingly, also made the following changes:
   - Add a couple of tests to fix the coverage and verify the new behaviour
   - Do not retry on `InterruptedException`
   - Do not alert on `InterruptedException` in polling methods
   



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Stop basic auth cache manager immediately on service shutdown (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz merged PR #18052:
URL: https://github.com/apache/druid/pull/18052


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Stop basic auth cache manager immediately on service shutdown (druid)

Posted by "gianm (via GitHub)" <gi...@apache.org>.
gianm commented on code in PR #18052:
URL: https://github.com/apache/druid/pull/18052#discussion_r2116893154


##########
extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:
##########
@@ -126,6 +126,9 @@ public void start()
               }
               LOG.debug("Scheduled user cache poll is done");
             }
+            catch (InterruptedException e) {
+              LOG.noStackTrace().warn(e, "Interrupted while polling Coordinator for cachedUserMaps.");

Review Comment:
   Generally, I like omitting the stack trace for `InterruptedException`, since it generally happens when a service is being shut down. It's annoying for a service to log a ton of stack traces when shutting down.
   
   Actually, I would drop this to `INFO` rather than `WARN`. Interruption here is expected behavior during a shutdown, nothing bad is happening, so it shouldn't warn.



##########
extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:
##########
@@ -126,6 +126,9 @@ public void start()
               }
               LOG.debug("Scheduled user cache poll is done");
             }
+            catch (InterruptedException e) {
+              LOG.noStackTrace().warn(e, "Interrupted while polling Coordinator for cachedUserMaps.");

Review Comment:
   Generally, I like omitting the stack trace for `InterruptedException`, since it generally happens when a service is being shut down. It's annoying for a service to log a ton of stack traces when shutting down.
   
   Actually, I would also drop this to `INFO` rather than `WARN`. Interruption here is expected behavior during a shutdown, nothing bad is happening, so it shouldn't warn.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Stop basic auth cache manager immediately on service shutdown (druid)

Posted by "jtuglu-netflix (via GitHub)" <gi...@apache.org>.
jtuglu-netflix commented on code in PR #18052:
URL: https://github.com/apache/druid/pull/18052#discussion_r2115411874


##########
extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:
##########
@@ -126,6 +126,9 @@ public void start()
               }
               LOG.debug("Scheduled user cache poll is done");
             }
+            catch (InterruptedException e) {
+              LOG.noStackTrace().warn(e, "Interrupted while polling Coordinator for cachedUserMaps.");

Review Comment:
   Could there be a situation where the stack trace is useful in explaining what the thread was doing?



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Stop basic auth cache manager immediately on service shutdown (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #18052:
URL: https://github.com/apache/druid/pull/18052#discussion_r2115414480


##########
extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/authentication/db/cache/CoordinatorPollingBasicAuthenticatorCacheManager.java:
##########
@@ -126,6 +126,9 @@ public void start()
               }
               LOG.debug("Scheduled user cache poll is done");
             }
+            catch (InterruptedException e) {
+              LOG.noStackTrace().warn(e, "Interrupted while polling Coordinator for cachedUserMaps.");

Review Comment:
   Hmm, I guess.
   We can include the stack trace, I don't feel strongly about it.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org