SteveYurongSu commented on code in PR #11489:
URL: https://github.com/apache/iotdb/pull/11489#discussion_r1400528021


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/task/subtask/connector/PipeConnectorSubtaskLifeCycle.java:
##########
@@ -66,14 +66,23 @@ public synchronized void register() {
   /**
    * Deregister the subtask. If the subtask is the last one, close the subtask.
    *
+   * @param pipeNameToDeregister pipe name
    * @return true if the subtask is out of life cycle, indicating that the 
subtask should never be
    *     used again
    * @throws IllegalStateException if aliveTaskCount <= 0
    */
-  public synchronized boolean deregister() {
+  public synchronized boolean deregister(String pipeNameToDeregister) {
+    // The stop() here keeps runningTaskCount consistent, otherwise there 
might be runningTaskCount
+    // > aliveTaskCount.
+    // Remember not to stop twice.
+    stop();

Review Comment:
   If the pipe was already stopped by user...



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

Reply via email to