You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/04/23 16:47:54 UTC

[GitHub] [druid] gianm commented on a change in pull request #5001: Fix removeDataSource() and removeSegment() of SQLMetadataSegmentManager

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:
users@infra.apache.org



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