Always set fd to be readable/writable on receiving EPOLLERR

pull/17310/head
Yash Tibrewal 6 years ago
parent 66b2005cbb
commit fe9ba9adf8
  1. 14
      src/core/lib/iomgr/tcp_posix.cc

@ -740,7 +740,7 @@ static bool process_errors(grpc_tcp* tcp) {
} }
return false; return false;
} }
process_timestamp(tcp, &msg, cmsg); cmsg = process_timestamp(tcp, &msg, cmsg);
} }
} }
} }
@ -761,13 +761,11 @@ static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error) {
/* We are still interested in collecting timestamps, so let's try reading /* We are still interested in collecting timestamps, so let's try reading
* them. */ * them. */
if (!process_errors(tcp)) { process_errors(tcp);
/* This was not a timestamps error. This was an actual error. Set the /* This might not a timestamps error. Set the read and write closures to be
* read and write closures to be ready. * ready. */
*/ grpc_fd_set_readable(tcp->em_fd);
grpc_fd_set_readable(tcp->em_fd); grpc_fd_set_writable(tcp->em_fd);
grpc_fd_set_writable(tcp->em_fd);
}
GRPC_CLOSURE_INIT(&tcp->error_closure, tcp_handle_error, tcp, GRPC_CLOSURE_INIT(&tcp->error_closure, tcp_handle_error, tcp,
grpc_schedule_on_exec_ctx); grpc_schedule_on_exec_ctx);
grpc_fd_notify_on_error(tcp->em_fd, &tcp->error_closure); grpc_fd_notify_on_error(tcp->em_fd, &tcp->error_closure);

Loading…
Cancel
Save