This is an automated email from the ASF dual-hosted git repository.
guangmingchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new b223e60b Fix RDMA resource (#3269)
b223e60b is described below
commit b223e60b578aa0391331f38ab176ec53a3c87c90
Author: Bright Chen <[email protected]>
AuthorDate: Tue Apr 14 11:01:54 2026 +0800
Fix RDMA resource (#3269)
---
src/brpc/rdma/rdma_endpoint.cpp | 1 +
test/bvar_variable_unittest.cpp | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/src/brpc/rdma/rdma_endpoint.cpp b/src/brpc/rdma/rdma_endpoint.cpp
index a939332f..ad2f684e 100644
--- a/src/brpc/rdma/rdma_endpoint.cpp
+++ b/src/brpc/rdma/rdma_endpoint.cpp
@@ -1200,6 +1200,7 @@ int RdmaEndpoint::AllocateResources() {
options.on_edge_triggered_events = PollCq;
if (Socket::Create(options, &_cq_sid) < 0) {
PLOG(WARNING) << "Fail to create socket for cq";
+ return -1;
}
} else {
SocketOptions options;
diff --git a/test/bvar_variable_unittest.cpp b/test/bvar_variable_unittest.cpp
index 7450da69..55a0e4b6 100644
--- a/test/bvar_variable_unittest.cpp
+++ b/test/bvar_variable_unittest.cpp
@@ -324,6 +324,18 @@ TEST_F(VariableTest, latency_recorder) {
ASSERT_EQ(-1, rec.expose("latency"));
ASSERT_EQ(-1, rec.expose("Latency"));
+ std::string saved_bvar_latency_p1;
+ std::string saved_bvar_latency_p2;
+ std::string saved_bvar_latency_p3;
+
+ GFLAGS_NAMESPACE::GetCommandLineOption("bvar_latency_p1",
&saved_bvar_latency_p1);
+ GFLAGS_NAMESPACE::GetCommandLineOption("bvar_latency_p2",
&saved_bvar_latency_p2);
+ GFLAGS_NAMESPACE::GetCommandLineOption("bvar_latency_p3",
&saved_bvar_latency_p3);
+
+ GFLAGS_NAMESPACE::SetCommandLineOption("bvar_latency_p1", "80");
+ GFLAGS_NAMESPACE::SetCommandLineOption("bvar_latency_p2", "90");
+ GFLAGS_NAMESPACE::SetCommandLineOption("bvar_latency_p3", "99");
+
ASSERT_EQ(0, rec.expose("FooBar__latency"));
std::vector<std::string> names;
@@ -373,6 +385,10 @@ TEST_F(VariableTest, latency_recorder) {
ASSERT_EQ("ba_na_na_latency_percentiles", names[8]);
ASSERT_EQ("ba_na_na_max_latency", names[9]);
ASSERT_EQ("ba_na_na_qps", names[10]);
+
+ GFLAGS_NAMESPACE::SetCommandLineOption("bvar_latency_p1",
saved_bvar_latency_p1.c_str());
+ GFLAGS_NAMESPACE::SetCommandLineOption("bvar_latency_p2",
saved_bvar_latency_p2.c_str());
+ GFLAGS_NAMESPACE::SetCommandLineOption("bvar_latency_p3",
saved_bvar_latency_p3.c_str());
}
TEST_F(VariableTest, recursive_mutex) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]