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:50:53 UTC

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

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



##########
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:
       Which for loop are you referring to? Can you link here? Also, there has been a pretty big refactoring for this class. Do you still see the same issue?




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