Use unsafe_cleanup!/1
to delete data after consumer has stopped
#2271
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.
When cleaning up a shape we call
cleanup!
and (in the case of FileStorage) attempt to remove the data directory while the CubDb process is still running.This fails (
File.rm_rf/1
returns{:error, :eexist, _}
) because the files are still in use.Instead of removing the directory on
cleanup!
while the process(es) are still running, instead teardown the consumer supervision tree and useunsafe_cleanup!/1
do remove the directories.unsafe_cleanup!
is already documented as something that should be runnable without any active processes, so this is an ideal use.Fixes problems with https://github.com/electric-sql/stratovolt/pull/243