cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r805615 - /incubator/cassandra/trunk/src/java/org/apache/cassandra/db/CommitLog.java
Date Tue, 18 Aug 2009 22:49:20 GMT
Author: jbellis
Date: Tue Aug 18 22:49:20 2009
New Revision: 805615

URL: http://svn.apache.org/viewvc?rev=805615&view=rev
Log:
add missing while loop on periodic commitlog sync thread.
patch by jbellis; reviewed by Chris Goffinet for CASSANDRA-367

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/CommitLog.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/CommitLog.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/CommitLog.java?rev=805615&r1=805614&r2=805615&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/CommitLog.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/CommitLog.java Tue Aug 18 22:49:20
2009
@@ -24,6 +24,7 @@
 import org.apache.cassandra.io.DataOutputBuffer;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.FileUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 
 import java.io.*;
@@ -198,14 +199,17 @@
                 {
                     public void run()
                     {
-                        executor.submit(syncer);
-                        try
-                        {
-                            Thread.sleep(DatabaseDescriptor.getCommitLogSyncPeriod());
-                        }
-                        catch (InterruptedException e)
+                        while (true)
                         {
-                            throw new RuntimeException(e);
+                            executor.submit(syncer);
+                            try
+                            {
+                                Thread.sleep(DatabaseDescriptor.getCommitLogSyncPeriod());
+                            }
+                            catch (InterruptedException e)
+                            {
+                                throw new RuntimeException(e);
+                            }
                         }
                     }
                 }).start();



Mime
View raw message