null check for writer if not initialized yet during syncrunner run

This commit is contained in:
Gaurav Kanade 2020-07-23 10:25:33 +05:30
parent 8191fbdd7d
commit 72932ad0df
1 changed files with 5 additions and 3 deletions

View File

@ -594,9 +594,11 @@ public class FSHLog extends AbstractFSWAL<Writer> {
long start = System.nanoTime(); long start = System.nanoTime();
Throwable lastException = null; Throwable lastException = null;
try { try {
TraceUtil.addTimelineAnnotation("syncing writer"); if(writer != null) {
writer.sync(sf.isForceSync()); TraceUtil.addTimelineAnnotation("syncing writer");
TraceUtil.addTimelineAnnotation("writer synced"); writer.sync(sf.isForceSync());
TraceUtil.addTimelineAnnotation("writer synced");
}
currentSequence = updateHighestSyncedSequence(currentSequence); currentSequence = updateHighestSyncedSequence(currentSequence);
} catch (IOException e) { } catch (IOException e) {
LOG.error("Error syncing, request close of WAL", e); LOG.error("Error syncing, request close of WAL", e);