fluo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject incubator-fluo git commit: Found and fixed two bugs while working on the Fluo Tour.
Date Thu, 01 Sep 2016 17:50:59 GMT
Repository: incubator-fluo
Updated Branches:
  refs/heads/master 7915c5df4 -> 468d1cfc4


Found and fixed two bugs while working on the Fluo Tour.

 * Threads were not shutting down
 * Multiple collisions of non trigger node was failing in commit


Project: http://git-wip-us.apache.org/repos/asf/incubator-fluo/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-fluo/commit/468d1cfc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-fluo/tree/468d1cfc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-fluo/diff/468d1cfc

Branch: refs/heads/master
Commit: 468d1cfc4bf43a49c5c7ffb2188ad67b62cc2d0d
Parents: 7915c5d
Author: Keith Turner <kturner@apache.org>
Authored: Fri Aug 12 18:44:40 2016 -0400
Committer: Keith Turner <kturner@apache.org>
Committed: Fri Aug 12 18:44:40 2016 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/fluo/core/impl/SharedResources.java | 8 ++++++++
 .../main/java/org/apache/fluo/core/impl/TransactionImpl.java | 2 +-
 .../java/org/apache/fluo/core/util/FluoThreadFactory.java    | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fluo/blob/468d1cfc/modules/core/src/main/java/org/apache/fluo/core/impl/SharedResources.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/SharedResources.java b/modules/core/src/main/java/org/apache/fluo/core/impl/SharedResources.java
index f56952d..e9a121a 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/SharedResources.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/SharedResources.java
@@ -192,6 +192,13 @@ public class SharedResources implements AutoCloseable {
       throw new RuntimeException(e1);
     }
 
+    syncCommitExecutor.shutdownNow();
+    try {
+      syncCommitExecutor.awaitTermination(5, TimeUnit.SECONDS);
+    } catch (InterruptedException e1) {
+      throw new RuntimeException(e1);
+    }
+
     if (tnode != null) {
       tnode.close();
     }
@@ -206,6 +213,7 @@ public class SharedResources implements AutoCloseable {
     }
     acw.close();
     cw.close();
+    bulkAcw.close();
     bulkCw.close();
     sbw.close();
     try {

http://git-wip-us.apache.org/repos/asf/incubator-fluo/blob/468d1cfc/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java
index f25099b..803e672 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java
@@ -922,11 +922,11 @@ public class TransactionImpl implements AsyncTransaction, Snapshot {
         cd.acceptedRows.add(row);
       } else {
         cd.addToRejected(row, updates.get(row).keySet());
-        getStats().setRejected(cd.getRejected());
       }
     }
 
     if (cd.getRejected().size() > 0) {
+      getStats().setRejected(cd.getRejected());
       env.getSharedResources().getSyncCommitExecutor().execute(new SynchronousCommitTask(cd)
{
         @Override
         protected void runCommitStep(CommitData cd) throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-fluo/blob/468d1cfc/modules/core/src/main/java/org/apache/fluo/core/util/FluoThreadFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/fluo/core/util/FluoThreadFactory.java b/modules/core/src/main/java/org/apache/fluo/core/util/FluoThreadFactory.java
index 4701bba..194db88 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/util/FluoThreadFactory.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/util/FluoThreadFactory.java
@@ -38,6 +38,7 @@ public class FluoThreadFactory implements ThreadFactory {
     String name =
         String.format("Fluo-%04d-%03d-%s", poolId, threadCount.incrementAndGet(), poolName);
     t.setName(name);
+    t.setDaemon(true);
     return t;
   }
 }


Mime
View raw message