Skip to content

Commit

Permalink
Remove fd from pollset when releasing the fd
Browse files Browse the repository at this point in the history
  • Loading branch information
yang-g committed May 7, 2019
1 parent a8644bb commit 7cab9c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/lib/iomgr/ev_epoll1_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ static void fd_shutdown_internal(grpc_fd* fd, grpc_error* why,
if (fd->read_closure->SetShutdown(GRPC_ERROR_REF(why))) {
if (!releasing_fd) {
shutdown(fd->fd, SHUT_RDWR);
} else {
if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_DEL, fd->fd, nullptr) != 0) {
gpr_log(GPR_ERROR, "epoll_ctl failed: %s", strerror(errno));
}
}
fd->write_closure->SetShutdown(GRPC_ERROR_REF(why));
fd->error_closure->SetShutdown(GRPC_ERROR_REF(why));
Expand Down

0 comments on commit 7cab9c7

Please sign in to comment.