imbajin commented on code in PR #3308:
URL: https://github.com/apache/hugegraph/pull/3308#discussion_r4242958978


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java:
##########
@@ -1203,26 +1204,46 @@ public void create(String configPath, GlobalMasterInfo 
nodeInfo) {
         this.configuration.file(confPath);
     }
 
+    public synchronized void clearBackendForDrop() {
+        if (!this.dropBackendCleared) {
+            this.clearBackend();
+            this.dropBackendCleared = true;
+        }
+    }
+
     @Override
     public void drop() {
-        this.clearBackend();
+        E.checkState(!this.closed() || this.dropBackendCleared,
+                     "Can't drop an already closed graph '%s' before clearing 
its backend",
+                     this.spaceGraphName());
+        if (!this.closed()) {
+            TaskScheduler scheduler = 
this.taskManager.getScheduler(this.params);
+            if (scheduler != null && !scheduler.close()) {

Review Comment:
   Restored the configured wait before destructive cleanup. close() first 
fences admission; drop() then waits up to task.wait_timeout outside the 
scheduler monitor and rechecks the close acknowledgement before clearing the 
backend. A short task can finish and deletion succeeds in the same request. A 
timeout still retains data, configuration and registrations for retry. The real 
short-task and active-owner timeout regressions both pass against the unchanged 
production source.



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

Reply via email to