Try and flush failed chunks repeatedly when we're shutting down. #234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #86
This is a particularly naive solution, but I think simpler is better. I considered only trying a fixed number of times; problem is we might still fail to flush some chunks but exit cleanly and never know, which I'd like to avoid.
The problem with this approach is if, because of some bug / logical error, the first chunk fails to flush and always fails to flush, we'll never try to flush any of the other chunks even if they might succeed. I'm tempted to put all the failing flushes on a second list and try them at the end, in a loop, to work around this. WDYT?
In the long run the real solution here is the WAL.