Skip to content

Commit

Permalink
HBASE-25927: Fix the log messages by not stringifying the exceptions …
Browse files Browse the repository at this point in the history
…in log (#3338)

Signed-off-by: Bharath Vissapragada <[email protected]>
  • Loading branch information
sandeepvinayak authored May 29, 2021
1 parent c1d299f commit 9a2027b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public long getStartPosition() {
source.locateRecoveredPaths(walGroupId);
break;
} catch (IOException e) {
LOG.error("Error while locating recovered queue paths, attempt #" + numRetries);
LOG.error("Error while locating recovered queue paths, attempt #" + numRetries, e);
numRetries++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ public void terminate(String reason, Exception cause, boolean clearMetrics,
if (cause == null) {
LOG.info("{} Closing source {} because: {}", logPeerId(), this.queueId, reason);
} else {
LOG.error("{} Closing source {} because an error occurred: {}",
logPeerId(), this.queueId, reason, cause);
LOG.error(String.format("%s Closing source %s because an error occurred: %s",
logPeerId(), this.queueId, reason), cause);
}
this.sourceRunning = false;
if (initThread != null && Thread.currentThread() != initThread) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.hbase.thirdparty.com.google.common.collect.Sets;
import org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;

Expand Down Expand Up @@ -925,8 +924,8 @@ public void run() {
LOG.error(String.format("ReplicationException: cannot claim dead region (%s)'s " +
"replication queue. Znode : (%s)" +
" Possible solution: check if znode size exceeds jute.maxBuffer value. " +
" If so, increase it for both client and server side." + e), deadRS,
queueStorage.getRsNode(deadRS));
" If so, increase it for both client and server side.",
deadRS, queueStorage.getRsNode(deadRS)), e);
server.abort("Failed to claim queue from dead regionserver.", e);
return;
}
Expand Down Expand Up @@ -1202,7 +1201,7 @@ public void removeCatalogReplicationSource(RegionInfo regionInfo) {
* This ReplicationSource is NOT created via {@link ReplicationSourceFactory}.
* @see #addSource(String) This is a specialization of the addSource call.
* @see #catalogReplicationSource for a note on this ReplicationSource's lifecycle (and more on
* why the special handling).
* why the special handling).
*/
private ReplicationSourceInterface createCatalogReplicationSource(RegionInfo regionInfo)
throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void run() {
}
} catch (IOException e) {
if (sleepMultiplier < maxRetriesMultiplier) {
LOG.debug("Failed to read stream of replication entries: " + e);
LOG.debug("Failed to read stream of replication entries: ", e);
sleepMultiplier++;
} else {
LOG.error("Failed to read stream of replication entries", e);
Expand Down Expand Up @@ -306,7 +306,7 @@ private boolean handleEofException(Exception e, WALEntryBatch batch)
return true;
}
} catch (IOException ioe) {
LOG.warn("Couldn't get file length information about log {}", queue.peek());
LOG.warn("Couldn't get file length information about log " + queue.peek(), ioe);
}
}
return false;
Expand Down Expand Up @@ -420,7 +420,7 @@ private Pair<Integer, Integer> countDistinctRowKeysAndHFiles(WALEdit edit) {
}
} catch (IOException e) {
LOG.error("Failed to deserialize bulk load entry from wal edit. "
+ "Then its hfiles count will not be added into metric.");
+ "Then its hfiles count will not be added into metric.", e);
}
}

Expand Down Expand Up @@ -457,8 +457,7 @@ private int sizeOfStoreFilesIncludeBulkLoad(WALEdit edit) {
} catch (IOException e) {
LOG.error("Failed to deserialize bulk load entry from wal edit. "
+ "Size of HFiles part of cell will not be considered in replication "
+ "request size calculation.",
e);
+ "request size calculation.", e);
}
}
}
Expand Down

0 comments on commit 9a2027b

Please sign in to comment.