-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6 1 #2470
base: master
Are you sure you want to change the base?
6 1 #2470
Conversation
Fixed writing pages in the same thread that does EnqueuePage
…context Don't capture synchronization context in DiskWriterQueue
…ion-in-ensure 2451 lazy string interpolation in ensure
# Conflicts: # LiteDB/Engine/Disk/DiskWriterQueue.cs
2451 fix disk writer queue
{ | ||
public static class Logging | ||
{ | ||
public static event Action<LogEventArgs> LogCallback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have at least some simple mechanism to hook to logs and log them - to reveal what is wrong if it fails in production
public bool IsDisposed => _state.Disposed; | ||
|
||
private readonly TaskCompletionSource<bool> _closedTask = new TaskCompletionSource<bool>(); | ||
public Task<bool> Closed => _closedTask.Task; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
give a chance to outside observer to check
if (db.IsDisposed)
{
await db.Closed;
}
recreate db
_state.Handle(ex); | ||
_state.Handle(LiteException.InvalidDatafileState(ex, "DiskWriterQueue failed")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make DiskWriterQueue exceptions "fatal" - these can't be survived and it is best to tear down the entire engine and let the outside observer to restart the engine (possibly with a rebuild)
ExhaustQueue(); | ||
} | ||
} | ||
|
||
private void ExhaustQueue() | ||
{ | ||
while (_queue.TryDequeue(out var page)) | ||
{ | ||
page.Release(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anything fails here we need to drop this object - this means all pages must be released (including the one that caused the failure - see the finally case below)
@ltetak were you planning on publishing this PR? I would love to have a way to hook into the logs from LiteDB to help diagnose issues we are getting in Production. |
Hello the LiteDB community. I would like to open a discussion about the stability of this tool. I have some thoughts first and then there is a draft here about some recent changes + some quick wins.