gianm commented on a change in pull request #5001:
URL: https://github.com/apache/druid/pull/5001#discussion_r413958158



##########
File path: server/src/main/java/io/druid/metadata/SQLMetadataSegmentManager.java
##########
@@ -144,26 +142,35 @@ public void run()
           delay.getMillis(),
           TimeUnit.MILLISECONDS
       );
-      started = true;
+      lifecycleLock.started();
+    }
+    finally {
+      lifecycleLock.exitStart();
     }
   }
 
   @Override
   @LifecycleStop
   public void stop()
   {
-    synchronized (lock) {
-      if (!started) {
-        return;
-      }
+    if (!lifecycleLock.canStop()) {
+      return;
+    }
+    try {
+      final ConcurrentHashMap<String, DruidDataSource> emptyMap = new 
ConcurrentHashMap<>();
+      ConcurrentHashMap<String, DruidDataSource> current;
+      do {
+        current = dataSourcesRef.get();

Review comment:
       This class was refactored extensively in #6370 and then renamed in #7306 
to SqlSegmentsMetadataManager. So this issue might not still exist. Have you 
been able to take a look at the new code?




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

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