bharathv commented on a change in pull request #3504:
URL: https://github.com/apache/hbase/pull/3504#discussion_r672591550
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestBasicWALEntryStream.java
##########
@@ -716,4 +717,52 @@ public void testCleanClosedWALs() throws Exception {
assertEquals(0, logQueue.getMetrics().getUncleanlyClosedWALs());
}
}
+
+ /**
+ * Tests that we handle EOFException properly if the wal has moved to
oldWALs directory.
+ * @throws Exception exception
+ */
+ @Test
+ public void testEOFExceptionInOldWALsDirectory() throws Exception {
+ assertEquals(1, logQueue.getQueueSize(fakeWalGroupId));
+ AbstractFSWAL abstractWAL = (AbstractFSWAL)log;
Review comment:
nit: We don't need this down cast, do we?
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java
##########
@@ -166,6 +168,14 @@ public void run() {
} catch (InterruptedException e) {
LOG.trace("Interrupted while sleeping between WAL reads or adding WAL
batch to ship queue");
Thread.currentThread().interrupt();
+ } finally {
+ try {
+ if (entryStream != null) {
+ entryStream.close();
+ }
+ } catch (IOException ioe) {
+ LOG.warn("Exception while closing WALEntryStream", ioe);
+ }
Review comment:
Can be simplified as follows,
`IOUtils.closeQuietly(entryStream, e -> LOG.warn("Exception while closing
WALEntryStream", e));`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]