mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Improved hpfs initialisation error handling. (#104)
This commit is contained in:
@@ -210,12 +210,16 @@ namespace cons
|
||||
|
||||
if (ctx.stage == 3)
|
||||
{
|
||||
if (apply_ledger(stg_prop) == -1)
|
||||
return -1;
|
||||
|
||||
// node has finished a consensus round (all 4 stages).
|
||||
LOG_INFO << "****Stage 3 consensus reached**** (lcl:" << ctx.lcl.substr(0, 15)
|
||||
<< " state:" << ctx.state << ")";
|
||||
if (apply_ledger(stg_prop) != -1)
|
||||
{
|
||||
// node has finished a consensus round (all 4 stages).
|
||||
LOG_INFO << "****Stage 3 consensus reached**** (lcl:" << ctx.lcl.substr(0, 15)
|
||||
<< " state:" << ctx.state << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERR << "Error occured in Stage 3 consensus execution.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -775,7 +779,10 @@ namespace cons
|
||||
// TODO: Do something usefull with HP<-->SC channel.
|
||||
|
||||
if (sc::execute_contract(ctx.contract_ctx) == -1)
|
||||
{
|
||||
LOG_ERR << "Contract execution failed.";
|
||||
return -1;
|
||||
}
|
||||
|
||||
ctx.state = args.post_execution_state_hash;
|
||||
extract_user_outputs_from_contract_bufmap(args.userbufs);
|
||||
|
||||
@@ -99,7 +99,10 @@ namespace hpfs
|
||||
|
||||
// Check if process is still running.
|
||||
if (kill(pid, 0) == -1)
|
||||
{
|
||||
LOG_ERR << "hpfs process " << pid << " has stopped.";
|
||||
break;
|
||||
}
|
||||
|
||||
// If hash map is enabled we check whether stat succeeds on the root hash.
|
||||
// If not, we check whether the inode no. of the mounted root dir is 1.
|
||||
@@ -107,7 +110,7 @@ namespace hpfs
|
||||
hpfs_initialized = (stat(check_path.c_str(), &st) == 0 &&
|
||||
(hash_map_enabled || st.st_ino == 1));
|
||||
|
||||
} while (!hpfs_initialized && ++retry_count < 100);
|
||||
} while (!hpfs_initialized && ++retry_count < 200);
|
||||
|
||||
// Kill the process if hpfs couldn't be initialized after the wait period.
|
||||
if (!hpfs_initialized)
|
||||
|
||||
Reference in New Issue
Block a user