We're not just called from the periodic commit timer, but also
on rehash, which includes some modreloads too (when reloading a
module that has configuration options).
We should always use a blocking save regardless of what caused
the save to happen, rather than just test in the periodic commit
timer callback.
This makes running under Valgrind much more amenable.
Fixes: b427d04059d4d4f7b396
{
slog(LG_DEBUG, "db_save_periodic(): initiating periodic database write");
- if (config_options.db_save_blocking)
- db_save(unused, DB_SAVE_BLOCKING);
- else
- db_save(unused, DB_SAVE_BG_REGULAR);
+ db_save(unused, DB_SAVE_BG_REGULAR);
}
int
#ifndef HAVE_FORK
corestorage_db_write_blocking(filename);
#else
-
if (child_pid && strategy == DB_SAVE_BG_REGULAR)
{
slog(LG_DEBUG, "db_save(): previous save unfinished, skipping save");
}
}
+ if (config_options.db_save_blocking)
+ strategy = DB_SAVE_BLOCKING;
+
if (strategy == DB_SAVE_BLOCKING)
{
corestorage_db_write_blocking(filename);