left open sockets were not really tested
diff --git a/src/event/ngx_event.h b/src/event/ngx_event.h
index a96b8ba..33c8cdc 100644
--- a/src/event/ngx_event.h
+++ b/src/event/ngx_event.h
@@ -136,6 +136,7 @@
 
     /* to test on worker exit */
     unsigned         channel:1;
+    unsigned         resolver:1;
 
 #if (NGX_THREADS)
 
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
index 96387f0..73b9d69 100644
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -994,18 +994,18 @@
         }
     }
 
-    if (ngx_quit) {
+    if (ngx_exiting) {
         c = cycle->connections;
         for (i = 0; i < cycle->connection_n; i++) {
             if (c[i].fd != -1
                 && c[i].read
                 && !c[i].read->accept
-                && !c[i].read->channel)
+                && !c[i].read->channel
+                && !c[i].read->resolver)
             {
                 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
-                              "open socket #%d left in %ui connection, "
-                              "aborting",
-                              c[i].fd, i);
+                              "open socket #%d left in %ui connection %s",
+                              c[i].fd, i, ngx_debug_quit ? ", aborting" : "");
                 ngx_debug_point();
             }
         }