Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Commit

Permalink
check for null bookmark before updating bookmark
Browse files Browse the repository at this point in the history
This has been found to occur if a program only generates a message(s) of a level that is not sent to the remote server (such as debug messages when the info level is the minimum). In this case, the bookmark file will exist on disk but be empty, and no messages will have been persisted on disk. The periodic check will fail in the UpdateBookmark call since no bookmark exists (null)
  • Loading branch information
Miguel Alho authored and MiguelAlho committed Jan 15, 2018
1 parent 617f2f9 commit c02872d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ public void MoveBookmarkForward()
//even if reading / deleteing files fails, we can / should update the bookmark file
//it is important that the file have the reset position, otherwise we risk failing to
// move forward in the next read cycle
_bookmarkProvider.UpdateBookmark(_currentBookmark);
//it's possible that no bookmark exists, especially if no valid messages have forced a
// durable log file to be created. In this case, the bookmark file will be empty and
// on disk
if(_currentBookmark != null)
_bookmarkProvider.UpdateBookmark(_currentBookmark);
}
}

Expand Down

0 comments on commit c02872d

Please sign in to comment.