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

refactor: make aio decoupled from dsn_runtime #778

Merged
merged 24 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/replica/replica_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#endif
#include <dsn/utility/fail_point.h>
#include <dsn/dist/remote_command.h>
#include <aio/disk_engine.h>
levy5307 marked this conversation as resolved.
Show resolved Hide resolved

namespace dsn {
namespace replication {
Expand Down Expand Up @@ -87,6 +88,11 @@ replica_stub::replica_stub(replica_state_subscriber subscriber /*= nullptr*/,
_fs_manager(false),
_bulk_load_downloading_count(0)
{

// make disk_engine destructed after replica_stub,
// because replica_stub relies on the former to close files.
disk_engine::instance();
levy5307 marked this conversation as resolved.
Show resolved Hide resolved

#ifdef DSN_ENABLE_GPERF
_release_tcmalloc_memory_command = nullptr;
_max_reserved_memory_percentage_command = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ add_library(dsn_runtime STATIC
tracer.cpp
zlocks.cpp
)
target_link_libraries(dsn_runtime PRIVATE dsn_utils sasl2 gssapi_krb5 krb5 dsn_aio)
target_link_libraries(dsn_runtime PRIVATE dsn_utils sasl2 gssapi_krb5 krb5)
install(TARGETS dsn_runtime DESTINATION "lib")
6 changes: 2 additions & 4 deletions src/runtime/service_api_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
* THE SOFTWARE.
*/

#include "aio/disk_engine.h"
#include "service_engine.h"
#include "utils/coredump.h"
#include "runtime/rpc/rpc_engine.h"
Expand Down Expand Up @@ -292,11 +291,10 @@ extern void dsn_core_init();

inline void dsn_global_init()
{
// make perf_counters/disk_engine destructed after service_engine,
// make perf_counters destructed after service_engine,
// because service_engine relies on the former to monitor
// task queues length and close files.
// task queues length.
dsn::perf_counters::instance();
dsn::disk_engine::instance();
dsn::service_engine::instance();
}

Expand Down