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

kturner pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new a2de3d7d99 adds validation to prevent possible deadlock (#3747)
a2de3d7d99 is described below

commit a2de3d7d9950426ba7b1455b6978b442be417c62
Author: Keith Turner <ktur...@apache.org>
AuthorDate: Thu Sep 14 18:10:28 2023 -0400

    adds validation to prevent possible deadlock (#3747)
---
 .../src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 31e9df9b89..d87b27e95a 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -1895,7 +1895,9 @@ public class Tablet extends TabletBase {
     ArrayList<String> otherLogsCopy = new ArrayList<>();
     ArrayList<String> currentLogsCopy = new ArrayList<>();
 
-    // do not hold tablet lock while acquiring the log lock
+    // Can not hold tablet lock while acquiring the log lock. The following 
check is there to
+    // prevent deadlock.
+    Preconditions.checkState(!Thread.holdsLock(this));
     logLock.lock();
 
     synchronized (this) {
@@ -1960,7 +1962,9 @@ public class Tablet extends TabletBase {
 
     boolean releaseLock = true;
 
-    // do not hold tablet lock while acquiring the log lock
+    // Can not hold tablet lock while acquiring the log lock. The following 
check is there to
+    // prevent deadlock.
+    Preconditions.checkState(!Thread.holdsLock(this));
     logLock.lock();
 
     try {

Reply via email to