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

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new fc0562914a6 branch-3.0: [fix](bdb) reset interrupted flag before 
calling bdbje #47874 (#47941)
fc0562914a6 is described below

commit fc0562914a6b6301988003e9b69e3f14e7d42191
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Feb 24 11:00:15 2025 +0800

    branch-3.0: [fix](bdb) reset interrupted flag before calling bdbje #47874 
(#47941)
    
    Cherry-picked from #47874
    
    Co-authored-by: Mingyu Chen (Rayner) <morning...@163.com>
---
 .../src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java | 5 +++++
 .../src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java   | 5 +++++
 2 files changed, 10 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java 
b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java
index ff162b0c9fa..14105232e0f 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java
@@ -336,6 +336,11 @@ public class BDBEnvironment {
 
     // get journal db names and sort the names
     public List<Long> getDatabaseNames() {
+        // The operation before may set the current thread as interrupted.
+        // MUST reset the interrupted flag of current thread to false,
+        // otherwise replicatedEnvironment.getDatabaseNames() will fail 
because it will call lock.tryLock(),
+        // which will check the interrupted flag.
+        Thread.interrupted();
         List<Long> ret = new ArrayList<Long>();
         List<String> names = null;
         int tried = 0;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java 
b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java
index 1c1bcf6354c..2a6a5b201e0 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java
@@ -225,6 +225,11 @@ public class BDBJEJournal implements Journal { // 
CHECKSTYLE IGNORE THIS LINE: B
 
     @Override
     public synchronized long write(short op, Writable writable) throws 
IOException {
+        // The operation before may set the current thread as interrupted.
+        // MUST reset the interrupted flag of current thread to false,
+        // otherwise edit log writing may fail because it will call 
lock.tryLock(),
+        // which will check the interrupted flag.
+        Thread.interrupted();
         JournalEntity entity = new JournalEntity();
         entity.setOpCode(op);
         entity.setData(writable);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to