You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "SteveYurongSu (via GitHub)" <gi...@apache.org> on 2023/07/12 16:16:36 UTC
[GitHub] [iotdb] SteveYurongSu commented on a diff in pull request #10537: Pipe: Fix deadlock in rolling back procedures concurrently
SteveYurongSu commented on code in PR #10537:
URL: https://github.com/apache/iotdb/pull/10537#discussion_r1261419539
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/task/PipeTaskCoordinator.java:
##########
@@ -73,14 +73,22 @@ public AtomicReference<PipeTaskInfo> lock() {
/**
* Unlock the pipe task coordinator. Calling this method will clear the pipe task info holder,
* which means that the holder will be null after calling this method.
+ *
+ * @return true if successfully unlocked, false if current thread is not holding the lock.
*/
- public void unlock() {
+ public boolean unlock() {
if (pipeTaskInfoHolder != null) {
pipeTaskInfoHolder.set(null);
pipeTaskInfoHolder = null;
}
- pipeTaskCoordinatorLock.unlock();
+ try {
+ pipeTaskCoordinatorLock.unlock();
+ } catch (IllegalMonitorStateException ignored) {
+ // This is thrown if unlock() is called without lock() called first.
Review Comment:
LOGGER.warn(...)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org