Ignore Connection Aborted errors on accept (#29318)

* Ignore Connection Aborted errors on accept

* Reviewer comments
pull/29374/head
Yash Tibrewal 3 years ago committed by GitHub
parent 88a706eaac
commit 5850cba295
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/core/lib/iomgr/tcp_server_posix.cc

@ -204,13 +204,13 @@ static void on_read(void* arg, grpc_error_handle err) {
strip off the ::ffff:0.0.0.0/96 prefix first. */ strip off the ::ffff:0.0.0.0/96 prefix first. */
int fd = grpc_accept4(sp->fd, &addr, 1, 1); int fd = grpc_accept4(sp->fd, &addr, 1, 1);
if (fd < 0) { if (fd < 0) {
switch (errno) { if (errno == EINTR) {
case EINTR:
continue; continue;
case EAGAIN: } else if (errno == EAGAIN || errno == ECONNABORTED ||
errno == EWOULDBLOCK) {
grpc_fd_notify_on_read(sp->emfd, &sp->read_closure); grpc_fd_notify_on_read(sp->emfd, &sp->read_closure);
return; return;
default: } else {
gpr_mu_lock(&sp->server->mu); gpr_mu_lock(&sp->server->mu);
if (!sp->server->shutdown_listeners) { if (!sp->server->shutdown_listeners) {
gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno)); gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno));

Loading…
Cancel
Save