Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

fix: use dsn::tools::native_aio_provider as default value of FLAGS_aio_factory_name #774

Merged
merged 14 commits into from
Mar 8, 2021
Prev Previous commit
Next Next commit
fix
  • Loading branch information
levy5307 committed Mar 4, 2021
commit fbfacb58f915a06932553236e757def1810917c8
19 changes: 12 additions & 7 deletions src/runtime/service_api_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,18 @@ bool run(const char *config_file,
bool is_server,
std::string &app_list)
{
// We put the loading of configuration at the beginning of this func.
// Because in dsn_global_init(), it calls perf_counters::instance(), which calls
// shared_io_service::instance(). And in the cstor of shared_io_service, it calls
// dsn_config_get_value_uint64() to load the corresponding configs. That will make
// dsn_config_get_value_uint64() get wrong value if we put dsn_config_load in behind of
// dsn_global_init()
if (!dsn_config_load(config_file, config_arguments)) {
printf("Fail to load config file %s\n", config_file);
return false;
}
dsn::flags_initialize();

dsn_global_init();
dsn_core_init();
::dsn::task::set_tls_dsn_context(nullptr, nullptr);
Expand All @@ -358,13 +370,6 @@ bool run(const char *config_file,
dsn_all.engine = &::dsn::service_engine::instance();
dsn_all.magic = 0xdeadbeef;

if (!dsn_config_load(config_file, config_arguments)) {
printf("Fail to load config file %s\n", config_file);
return false;
}

dsn::flags_initialize();

// pause when necessary
if (dsn_config_get_value_bool("core",
"pause_on_start",
Expand Down