You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/coordinator/task/PipeTaskCoordinator.java
+2-12Lines changed: 2 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -82,19 +82,9 @@ public AtomicReference<PipeTaskInfo> lock() {
82
82
/**
83
83
* Unlock the pipe task coordinator. Calling this method will clear the pipe task info holder,
84
84
* which means that the holder will be null after calling this method.
85
-
*
86
-
* @return {@code true} if successfully unlocked, {@code false} if current thread is not holding
87
-
* the lock.
88
85
*/
89
-
publicbooleanunlock() {
90
-
try {
91
-
pipeTaskCoordinatorLock.unlock();
92
-
returntrue;
93
-
} catch (IllegalMonitorStateExceptionignored) {
94
-
// This is thrown if unlock() is called without lock() called first.
95
-
LOGGER.warn("This thread is not holding the lock.");
Copy file name to clipboardExpand all lines: iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/coordinator/task/PipeTaskCoordinatorLock.java
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -22,24 +22,29 @@
22
22
importorg.slf4j.Logger;
23
23
importorg.slf4j.LoggerFactory;
24
24
25
+
importjava.util.concurrent.Semaphore;
25
26
importjava.util.concurrent.TimeUnit;
26
-
importjava.util.concurrent.locks.ReentrantLock;
27
27
28
28
/**
29
-
* {@link PipeTaskCoordinatorLock} is a crossthread lock for pipe task coordinator. It is used to
29
+
* {@link PipeTaskCoordinatorLock} is a cross-thread lock for pipe task coordinator. It is used to
30
30
* ensure that only one thread can execute the pipe task coordinator at the same time.
31
+
*
32
+
* <p>Uses {@link Semaphore} instead of {@link java.util.concurrent.locks.ReentrantLock} to support
33
+
* cross-thread acquire/release, which is required by the procedure recovery mechanism: locks may be
34
+
* acquired on the StateMachineUpdater thread during {@code restoreLock()} and released on a
Copy file name to clipboardExpand all lines: iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/subscription/SubscriptionCoordinator.java
+2-8Lines changed: 2 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -105,14 +105,8 @@ public boolean unlock() {
105
105
subscriptionInfoHolder = null;
106
106
}
107
107
108
-
try {
109
-
coordinatorLock.unlock();
110
-
returntrue;
111
-
} catch (IllegalMonitorStateExceptionignored) {
112
-
// This is thrown if unlock() is called without lock() called first.
113
-
LOGGER.warn("This thread is not holding the lock.");
0 commit comments