Skip to content

Commit

Permalink
Fix rdma complie error (#2707)
Browse files Browse the repository at this point in the history
* Fix rdma complie error

* Fix ut bins
  • Loading branch information
chenBright authored Jul 25, 2024
1 parent a48d4ce commit 7a89de7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
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

0 comments on commit 7a89de7

Please sign in to comment.