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 5370513fb5 closes reader deep copies outside of lock in FileManager 
(#5015)
5370513fb5 is described below

commit 5370513fb586415e7c121adff8cfa31a8d0d4c72
Author: Keith Turner <ktur...@apache.org>
AuthorDate: Mon Oct 28 17:22:28 2024 -0400

    closes reader deep copies outside of lock in FileManager (#5015)
    
    FileManager has a goal of doing all I/O outside of locks in its code to
    avoid one scan blocking another w/ I/O related to opening and closing
    files.  The code violated this goal when closing deep copies on an
    rfile and did this inside a lock.  This change moves the close outside
    of the lock.
---
 .../org/apache/accumulo/server/fs/FileManager.java     | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/fs/FileManager.java 
b/server/base/src/main/java/org/apache/accumulo/server/fs/FileManager.java
index adceeeb1c0..b2f9daeccd 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/FileManager.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/FileManager.java
@@ -349,6 +349,15 @@ public class FileManager {
       boolean sawIOException) {
     // put files in openFiles
 
+    for (FileSKVIterator reader : readers) {
+      try {
+        reader.closeDeepCopies();
+      } catch (IOException e) {
+        log.warn("{}", e.getMessage(), e);
+        sawIOException = true;
+      }
+    }
+
     synchronized (this) {
 
       // check that readers were actually reserved ... want to make sure a 
thread does
@@ -357,15 +366,6 @@ public class FileManager {
         throw new IllegalArgumentException("Asked to release readers that were 
never reserved ");
       }
 
-      for (FileSKVIterator reader : readers) {
-        try {
-          reader.closeDeepCopies();
-        } catch (IOException e) {
-          log.warn("{}", e.getMessage(), e);
-          sawIOException = true;
-        }
-      }
-
       for (FileSKVIterator reader : readers) {
         String fileName = reservedReaders.remove(reader);
         if (!sawIOException) {

Reply via email to