Skip to content

Commit e9e9eac

Browse files
authored
[rdma]fix and update (#977)
1 parent 81e6f75 commit e9e9eac

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

include/ylt/coro_io/ibverbs/ib_device.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ class ib_device_t {
174174
throw std::system_error(ec);
175175
}
176176

177-
ELOG_TRACE << "Active MTU: " << detail::mtu_str(attr_.active_mtu) << ", "
177+
ELOG_TRACE << name_ << " Active MTU: " << detail::mtu_str(attr_.active_mtu)
178+
<< ", "
178179
<< "Max MTU: " << detail::mtu_str(attr_.max_mtu);
179180

180181
find_best_gid_index();

include/ylt/coro_io/ibverbs/ib_socket.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,12 @@ class ib_socket_t {
823823
}
824824

825825
if (ec) {
826+
auto send_cb = std::move(self->send_cb_);
826827
self->close();
827828
ib_socket_shared_state_t::resume(std::pair{ec, std::size_t{0}},
828829
self->recv_cb_);
829830
ib_socket_shared_state_t::resume(std::pair{ec, std::size_t{0}},
830-
self->send_cb_);
831+
send_cb);
831832
break;
832833
}
833834
}

include/ylt/metric/metric.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,8 @@
88
#include <regex>
99
#include <span>
1010
#include <string>
11-
#include <thread>
1211
#include <vector>
1312

14-
#include "async_simple/coro/Lazy.h"
15-
#include "async_simple/coro/SyncAwait.h"
16-
#include "cinatra/cinatra_log_wrapper.hpp"
17-
#if __has_include("ylt/coro_io/coro_io.hpp")
18-
#include "ylt/coro_io/coro_io.hpp"
19-
#else
20-
#include "cinatra/ylt/coro_io/coro_io.hpp"
21-
#endif
22-
2313
#ifdef CINATRA_ENABLE_METRIC_JSON
2414
namespace iguana {
2515

include/ylt/metric/metric_manager.hpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
#pragma once
2+
#include <iostream>
23
#include <shared_mutex>
34
#include <system_error>
5+
#include <thread>
46
#include <utility>
57

8+
#include "async_simple/coro/Lazy.h"
9+
#include "async_simple/coro/SyncAwait.h"
10+
#if __has_include("ylt/coro_io/coro_io.hpp")
11+
#include "ylt/coro_io/coro_io.hpp"
12+
#else
13+
#include "cinatra/ylt/coro_io/coro_io.hpp"
14+
#endif
615
#include "metric.hpp"
716
#include "ylt/util/map_sharded.hpp"
817

@@ -11,14 +20,14 @@ class manager_helper {
1120
public:
1221
static bool register_metric(auto& metric_map, auto metric) {
1322
if (metric::metric_t::g_user_metric_count > ylt_metric_capacity) {
14-
CINATRA_LOG_ERROR << "metric count at capacity size: "
15-
<< metric::metric_t::g_user_metric_count;
23+
std::cerr << "metric count at capacity size: "
24+
<< metric::metric_t::g_user_metric_count << std::endl;
1625
return false;
1726
}
1827
auto&& [it, r] = metric_map.try_emplace(metric->str_name(), metric);
1928
if (!r) {
20-
CINATRA_LOG_ERROR << "duplicate registered metric name: "
21-
<< metric->str_name();
29+
std::cerr << "duplicate registered metric name: " << metric->str_name()
30+
<< std::endl;
2231
return false;
2332
}
2433

src/coro_rpc/benchmark/bench.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ int main(int argc, char** argv) {
184184
easylog::set_async(false);
185185

186186
#ifdef YLT_ENABLE_IBV
187-
coro_io::g_ib_buffer_pool({.buffer_size = conf.buffer_size});
187+
if (conf.enable_ib) {
188+
coro_io::g_ib_buffer_pool({.buffer_size = conf.buffer_size});
189+
}
188190
#endif
189191

190192
if (conf.client_concurrency == 0) {

0 commit comments

Comments
 (0)