aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/tcp_server_posix.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-01-27 11:37:37 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-01-27 11:37:37 -0800
commitcda759d658980346eb6a5673a36cda7f1906da3e (patch)
tree1780af79c602f6996e3fee01e9964a5d292a1e94 /src/core/lib/iomgr/tcp_server_posix.c
parent46357c882df1afc28f7a5228c40fde522093fa32 (diff)
Add an error to fd_shutdown (and recursively)
Allows diagnosing WHY a file descriptor was shutdown prematurely.
Diffstat (limited to 'src/core/lib/iomgr/tcp_server_posix.c')
-rw-r--r--src/core/lib/iomgr/tcp_server_posix.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c
index 20efb678b2..e9e7511c9c 100644
--- a/src/core/lib/iomgr/tcp_server_posix.c
+++ b/src/core/lib/iomgr/tcp_server_posix.c
@@ -276,7 +276,8 @@ static void tcp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
if (s->active_ports) {
grpc_tcp_listener *sp;
for (sp = s->head; sp; sp = sp->next) {
- grpc_fd_shutdown(exec_ctx, sp->emfd);
+ grpc_fd_shutdown(exec_ctx, sp->emfd,
+ GRPC_ERROR_CREATE("Server destroyed"));
}
gpr_mu_unlock(&s->mu);
} else {
@@ -773,7 +774,8 @@ void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx,
if (s->active_ports) {
grpc_tcp_listener *sp;
for (sp = s->head; sp; sp = sp->next) {
- grpc_fd_shutdown(exec_ctx, sp->emfd);
+ grpc_fd_shutdown(exec_ctx, sp->emfd,
+ GRPC_ERROR_CREATE("Server shutdown"));
}
}
gpr_mu_unlock(&s->mu);