]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsSearcherBase.java
IndexedRelationsSearcherBase possible deadlock with semaphore
[simantics/platform.git] / bundles / org.simantics.db.indexing / src / org / simantics / db / indexing / IndexedRelationsSearcherBase.java
index 9441bb75b8ee5a4a3c7fd419ac725e70778cd3ca..71db7f6168ac525d69cf1356329f1af081068792 100644 (file)
@@ -160,12 +160,14 @@ abstract public class IndexedRelationsSearcherBase {
 
        // Cannot move into read from no index
        if (State.NONE ==  this.state && State.READ == state) {
-           getLogger().info("Cannot move into read from no index in {} with state {}", this, state);
+           if (getLogger().isDebugEnabled())
+               getLogger().debug("Cannot move into read from no index in {} with state {}", this, state);
            return;
        }
        // Cannot move into write from no index
        if (State.NONE ==  this.state && State.WRITE == state) {
-           getLogger().info("Cannot move into write from no index in {} with state {}", this, state);
+           if (getLogger().isDebugEnabled())
+               getLogger().debug("Cannot move into write from no index in {} with state {}", this, state);
            return;
        }
        
@@ -627,7 +629,8 @@ abstract public class IndexedRelationsSearcherBase {
         if (overwrite) {
             if (Files.exists(indexPath)) {
                 mon.subTask("Erasing previous index");
-                getLogger().info("Erasing previous index {}", indexPath.toAbsolutePath());
+                if (getLogger().isDebugEnabled())
+                    getLogger().debug("Erasing previous index {}", indexPath.toAbsolutePath());
                 FileUtils.delete(indexPath);
             }
         }
@@ -695,10 +698,10 @@ abstract public class IndexedRelationsSearcherBase {
                                 }
                             }
                         }
-
-                        s.release();
                     } catch (DatabaseException e) {
                         throw new IllegalStateException(e);
+                    } finally {
+                        s.release();
                     }
                 });
             }