Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chenBright committed Apr 1, 2024
1 parent b022604 commit e9c747a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/brpc/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ int Socket::WaitEpollOut(int fd, bool pollin, const timespec* abstime) {
// health checker which called `SetFailed' before
const int expected_val = _epollout_butex->load(butil::memory_order_relaxed);
EventDispatcher& edisp = GetGlobalEventDispatcher(fd, _bthread_tag);
if (edisp.RegisterEvent(event_data_id(), fd, pollin) != 0) {
if (edisp.RegisterEvent(_event_data_id, fd, pollin) != 0) {
return -1;
}

Expand Down Expand Up @@ -1409,7 +1409,8 @@ int Socket::HandleEpollOutRequest(int error_code, EpollOutRequest* req) {
}
// We've got the right to call user callback
// The timer will be removed inside destructor of EpollOutRequest
GetGlobalEventDispatcher(req->fd, _bthread_tag).UnregisterEvent(id(), req->fd, false);
GetGlobalEventDispatcher(req->fd, _bthread_tag)
.UnregisterEvent(_event_data_id, req->fd, false);
return req->on_epollout_event(req->fd, error_code, req->data);
}

Expand Down Expand Up @@ -1512,6 +1513,7 @@ inline int SetError(bthread_id_t id_wait, int ec) {
}

int Socket::ConductError(bthread_id_t id_wait) {
pthread_mutex_lock(&_id_wait_list_mutex);
if (Failed()) {
const int error_code = non_zero_error_code();
if (id_wait != INVALID_BTHREAD_ID) {
Expand Down

0 comments on commit e9c747a

Please # to comment.