Integrated hpfs in-proc sessions. (#134)

This commit is contained in:
Ravin Perera
2020-10-23 10:04:45 +05:30
committed by GitHub
parent 4f6ff4fbef
commit 7a4e91b0dd
12 changed files with 278 additions and 201 deletions

View File

@@ -34,6 +34,7 @@ namespace state_sync
REQUEST_RESUBMIT_TIMEOUT = state_common::get_request_resubmit_timeout();
ctx.target_state = hpfs::h32_empty;
ctx.state_sync_thread = std::thread(state_syncer_loop);
ctx.hpfs_mount_dir = conf::ctx.state_rw_dir;
init_success = true;
return 0;
}
@@ -88,8 +89,7 @@ namespace state_sync
LOG_INFO << "State sync: Starting sync for target state: " << ctx.target_state;
}
pid_t hpfs_pid = 0;
if (hpfs::start_fs_session(hpfs_pid, ctx.hpfs_mount_dir, "rw", true) != -1)
if (hpfs::start_fs_session(ctx.hpfs_mount_dir) != -1)
{
while (!ctx.is_shutting_down)
{
@@ -119,10 +119,8 @@ namespace state_sync
}
}
}
// Stop hpfs rw session.
LOG_DEBUG << "State sync: Stopping hpfs session... pid:" << hpfs_pid;
util::kill_process(hpfs_pid, true);
hpfs::stop_fs_session(ctx.hpfs_mount_dir);
}
else
{