You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ra...@apache.org on 2012/01/22 18:43:17 UTC
svn commit: r1234559 - in /hbase/trunk: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
Author: ramkrishna
Date: Sun Jan 22 17:43:16 2012
New Revision: 1234559
URL: http://svn.apache.org/viewvc?rev=1234559&view=rev
Log:
HBASE-5243 LogSyncerThread not getting shutdown waiting for the interrupted flag (Ram)
Modified:
hbase/trunk/CHANGES.txt
hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1234559&r1=1234558&r2=1234559&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Sun Jan 22 17:43:16 2012
@@ -9,6 +9,7 @@ Release 0.92.1 - Unreleased
HBASE-5237 Addendum for HBASE-5160 and HBASE-4397 (Ram)
HBASE-5235 HLogSplitter writer thread's streams not getting closed when any
of the writer threads has exceptions. (Ram)
+ HBASE-5243 LogSyncerThread not getting shutdown waiting for the interrupted flag (Ram)
TESTS
HBASE-5223 TestMetaReaderEditor is missing call to CatalogTracker.stop()
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java?rev=1234559&r1=1234558&r2=1234559&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java Sun Jan 22 17:43:16 2012
@@ -958,6 +958,7 @@ public class HLog implements Syncable {
public void close() throws IOException {
try {
logSyncerThread.interrupt();
+ logSyncerThread.close();
// Make sure we synced everything
logSyncerThread.join(this.optionalFlushInterval*2);
} catch (InterruptedException e) {
@@ -1169,6 +1170,8 @@ public class HLog implements Syncable {
class LogSyncer extends HasThread {
private final long optionalFlushInterval;
+
+ private boolean closeLogSyncer = false;
// List of pending writes to the HLog. There corresponds to transactions
// that have not yet returned to the client. We keep them cached here
@@ -1187,7 +1190,7 @@ public class HLog implements Syncable {
try {
// awaiting with a timeout doesn't always
// throw exceptions on interrupt
- while(!this.isInterrupted()) {
+ while(!this.isInterrupted() && !closeLogSyncer) {
try {
if (unflushedEntries.get() <= syncedTillHere) {
@@ -1232,6 +1235,10 @@ public class HLog implements Syncable {
writer.append(e);
}
}
+
+ void close(){
+ closeLogSyncer = true;
+ }
}
// sync all known transactions