Merge pull request #18930 from yang-g/why_release_me_not

Remove fd from pollset when releasing the fd
pull/18955/head^2
Yang Gao 6 years ago committed by GitHub
commit e9672bfb99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/core/lib/iomgr/ev_epoll1_linux.cc

@ -383,6 +383,13 @@ 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 {
/* we need a dummy event for earlier linux versions. */
epoll_event dummy_event;
if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_DEL, fd->fd, &dummy_event) !=
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));

Loading…
Cancel
Save