This is an automated email from the ASF dual-hosted git repository.

tanxinyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 1697f545307 Fixed the NullPointerException caused by non-current table 
procedures #15238
1697f545307 is described below

commit 1697f54530714cb8bb5d3733f4100bc39eccb4b4
Author: Caideyipi <[email protected]>
AuthorDate: Mon Mar 31 20:13:47 2025 +0800

    Fixed the NullPointerException caused by non-current table procedures #15238
---
 .../org/apache/iotdb/confignode/manager/ProcedureManager.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
index 74522357061..6f321044e65 100644
--- 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
+++ 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
@@ -1710,6 +1710,10 @@ public class ProcedureManager {
     return waitingProcedureFinished(procedure);
   }
 
+  private TSStatus waitingProcedureFinished(final long procedureId) {
+    return waitingProcedureFinished(executor.getProcedures().get(procedureId));
+  }
+
   /**
    * Waiting until the specific procedure finished.
    *
@@ -1871,6 +1875,7 @@ public class ProcedureManager {
       final TDeleteTableDeviceReq req, final boolean isGeneratedByPipe) {
     long procedureId;
     DeleteDevicesProcedure procedure = null;
+    final TSStatus status;
     synchronized (this) {
       final Pair<Long, Boolean> procedureIdDuplicatePair =
           checkDuplicateTableTask(
@@ -1898,9 +1903,11 @@ public class ProcedureManager {
                 req.getModInfo(),
                 isGeneratedByPipe);
         this.executor.submitProcedure(procedure);
+        status = waitingProcedureFinished(procedure);
+      } else {
+        status = waitingProcedureFinished(procedureId);
       }
     }
-    TSStatus status = waitingProcedureFinished(procedure);
     if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
       return new TDeleteTableDeviceResp(StatusUtils.OK)
           .setDeletedNum(
@@ -1932,6 +1939,8 @@ public class ProcedureManager {
               "Some other task is operating table with same name.");
         }
         this.executor.submitProcedure(procedure);
+      } else {
+        return waitingProcedureFinished(procedureId);
       }
     }
     return waitingProcedureFinished(procedure);

Reply via email to