Skip to content

Commit 6f7ab09

Browse files
committed
Refine Transport Debug method param and RdmaTransport WaitEpollOut code
1 parent 7298399 commit 6f7ab09

File tree

6 files changed

+7
-15
lines changed

6 files changed

+7
-15
lines changed

src/brpc/rdma_transport.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,7 @@ namespace brpc {
118118
}
119119
}
120120
} else {
121-
g_vars->nwaitepollout << 1;
122-
const int rc = _socket->WaitEpollOut(_socket->fd(), pollin, &duetime);
123-
if (rc < 0 && errno != ETIMEDOUT) {
124-
const int saved_errno = errno;
125-
PLOG(WARNING) << "Fail to wait epollout of " << _socket;
126-
_socket->SetFailed(saved_errno, "Fail to wait epollout of %s: %s",
127-
_socket->description().c_str(), berror(saved_errno));
128-
return 1;
129-
}
121+
return _tcp_transport->WaitEpollOut(_epollout_butex, pollin, duetime);
130122
}
131123
return 0;
132124
}
@@ -180,7 +172,7 @@ namespace brpc {
180172
}
181173
}
182174

183-
void RdmaTransport::Debug(std::ostream &os, Socket* ptr) {
175+
void RdmaTransport::Debug(std::ostream &os) {
184176
if (_rdma_state == RDMA_ON && _rdma_ep) {
185177
_rdma_ep->DebugInfo(os);
186178
}

src/brpc/rdma_transport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace brpc {
3838
int WaitEpollOut(butil::atomic<int>* _epollout_butex, bool pollin, const timespec duetime) override;
3939
void ProcessEvent(bthread_attr_t attr) override;
4040
void QueueMessage(InputMessageClosure& inputMsg, int* num_bthread_created, bool last_msg) override;
41-
void Debug(std::ostream &os, Socket* ptr) override;
41+
void Debug(std::ostream &os) override;
4242
rdma::RdmaEndpoint* GetRdmaEp() {
4343
CHECK(_rdma_ep != NULL);
4444
return _rdma_ep;

src/brpc/socket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,7 @@ void Socket::DebugSocket(std::ostream& os, SocketId id) {
24932493
<< "\n}";
24942494
}
24952495
#endif
2496-
ptr->_transport->Debug(os, ptr.get());
2496+
ptr->_transport->Debug(os);
24972497
{ os << "\nbthread_tag=" << ptr->_io_event.bthread_tag(); }
24982498
}
24992499

src/brpc/tcp_transport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,5 @@ namespace brpc {
9090
ProcessInputMessage(to_run_msg);
9191
}
9292
}
93-
void TcpTransport::Debug(std::ostream &os, Socket* ptr) {}
93+
void TcpTransport::Debug(std::ostream &os) {}
9494
}

src/brpc/tcp_transport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace brpc {
3434
int WaitEpollOut(butil::atomic<int>* _epollout_butex, bool pollin, const timespec duetime) override;
3535
void ProcessEvent(bthread_attr_t attr) override;
3636
void QueueMessage(InputMessageClosure& input_msg, int* num_bthread_created, bool last_msg) override;
37-
void Debug(std::ostream &os, Socket* ptr) override;
37+
void Debug(std::ostream &os) override;
3838
};
3939
}
4040

src/brpc/transport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace brpc {
4949
virtual int WaitEpollOut(butil::atomic<int>* _epollout_butex, bool pollin, const timespec duetime) = 0;
5050
virtual void ProcessEvent(bthread_attr_t attr) = 0;
5151
virtual void QueueMessage(InputMessageClosure& input_msg, int* num_bthread_created, bool last_msg) = 0;
52-
virtual void Debug(std::ostream &os, Socket* ptr) = 0;
52+
virtual void Debug(std::ostream &os) = 0;
5353

5454
bool HasOnEdgeTrigger() {
5555
return _on_edge_trigger != NULL;

0 commit comments

Comments
 (0)