Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rdma complie error #2707

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion .github/actions/install-all-dependences/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ runs:
using: "composite"
steps:
- uses: ./.github/actions/install-essential-dependences
- run: sudo apt-get install -y libgoogle-glog-dev automake bison flex libboost-all-dev libevent-dev libtool pkg-config
- run: sudo apt-get install -y libgoogle-glog-dev automake bison flex libboost-all-dev libevent-dev libtool pkg-config libibverbs1 libibverbs-dev
shell: bash
- run: wget https://archive.apache.org/dist/thrift/0.11.0/thrift-0.11.0.tar.gz && tar -xf thrift-0.11.0.tar.gz
shell: bash
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ jobs:
- uses: ./.github/actions/install-all-dependences
- uses: ./.github/actions/init-make-config
with:
options: --cc=gcc --cxx=g++ --with-thrift --with-glog
options: --cc=gcc --cxx=g++ --with-thrift --with-glog --with-rdma
- name: compile
run: |
make -j ${{env.proc_num}}
make -j ${{env.proc_num}}

gcc-compile-with-cmake-all-options:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-all-dependences
- name: cmake
- name: cmake
run: |
export CC=gcc && export CXX=g++
mkdir build
cd build
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON ..
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=ON ..
- name: compile
run: |
cd build
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
- uses: ./.github/actions/install-all-dependences
- uses: ./.github/actions/init-make-config
with:
options: --cc=clang --cxx=clang++ --with-thrift --with-glog
options: --cc=clang --cxx=clang++ --with-thrift --with-glog --with-rdma
- name: compile
run: |
make -j ${{env.proc_num}}
Expand All @@ -145,12 +145,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-all-dependences
- name: cmake
- name: cmake
run: |
export CC=clang && export CXX=clang++
mkdir build
cd build
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON ..
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=ON ..
- name: compile
run: |
cd build
Expand All @@ -170,7 +170,8 @@ jobs:
- name: install gtest
run: |
sudo apt-get update
sudo apt-get install -y cmake libgtest-dev gdb && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv lib/libgtest* /usr/lib/
sudo apt-get install -y cmake libgtest-dev gdb
cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv lib/libgtest* /usr/lib/
- uses: ./.github/actions/init-make-config
with:
options: --cc=clang --cxx=clang++
Expand Down
4 changes: 2 additions & 2 deletions src/brpc/rdma/rdma_endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ void RdmaEndpoint::DeallocateResources() {
if (_resource->comp_channel) {
// destroy comp_channel will destroy this fd
// so that we should remove it from epoll fd first
GetGlobalEventDispatcher(fd, _socket->_bthread_tag).RemoveConsumer(fd);
_socket->_io_event.RemoveConsumer(fd);
fd = -1;
if (IbvDestroyCompChannel(_resource->comp_channel) < 0) {
PLOG(WARNING) << "Fail to destroy CQ channel";
Expand All @@ -1273,7 +1273,7 @@ void RdmaEndpoint::DeallocateResources() {
if (Socket::Address(_cq_sid, &s) == 0) {
s->_user = NULL; // do not release user (this RdmaEndpoint)
if (fd >= 0) {
GetGlobalEventDispatcher(fd, _socket->_bthread_tag).RemoveConsumer(fd);
_socket->_io_event.RemoveConsumer(fd);
}
s->_fd = -1; // already remove fd from epoll fd
s->SetFailed();
Expand Down
2 changes: 1 addition & 1 deletion src/brpc/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ int Socket::OnCreated(const SocketOptions& options) {
#if BRPC_WITH_RDMA
CHECK(_rdma_ep == NULL);
if (options.use_rdma) {
_rdma_ep = new (std::nothrow)rdma::RdmaEndpoint(m);
_rdma_ep = new (std::nothrow)rdma::RdmaEndpoint(this);
if (!_rdma_ep) {
const int saved_errno = errno;
PLOG(ERROR) << "Fail to create RdmaEndpoint";
Expand Down
2 changes: 1 addition & 1 deletion test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rm core.*
test_num=0
failed_test=""
rc=0
test_bins="test_butil test_bvar bthread*unittest brpc*unittest"
test_bins="brpc_rdma_unittest brpc_socket_unittest"
chenBright marked this conversation as resolved.
Show resolved Hide resolved
for test_bin in $test_bins; do
test_num=$((test_num + 1))
>&2 echo "[runtest] $test_bin"
Expand Down
Loading