Do not respond to SYNC_COM_CHANNEL_CLOSE requests
authorAndrew Deason <adeason@sinenomine.net>
Wed, 9 Sep 2009 14:22:02 +0000 (09:22 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Fri, 11 Sep 2009 16:49:30 +0000 (09:49 -0700)
SYNC clients, when closing a channel, send a SYNC_COM_CHANNEL_CLOSE
command, and immediately disconnect before waiting for a response. So,
don't send a SYNC response, since by the time we send it, the other end
will most likely have already hung up, causing a lot of needless
'SYNC_putRes: write failed' messages whenever a SYNC channel is closed
(e.g. when a demand-salvage finishes).

Reviewed-on: http://gerrit.openafs.org/434
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/vol/fssync-server.c
src/vol/salvsync-server.c

index d596056..482bd24 100644 (file)
@@ -360,7 +360,10 @@ FSYNC_com(osi_socket fd)
     if (com.hdr.command == SYNC_COM_CHANNEL_CLOSE) {
        res.hdr.response = SYNC_OK;
        res.hdr.flags |= SYNC_FLAG_CHANNEL_SHUTDOWN;
-       goto respond;
+
+       /* don't respond, just drop; senders of SYNC_COM_CHANNEL_CLOSE
+        * never wait for a response. */
+       goto done;
     }
 
     res.hdr.com_seq = com.hdr.com_seq;
@@ -400,6 +403,8 @@ FSYNC_com(osi_socket fd)
 
  respond:
     SYNC_putRes(&fssync_server_state, fd, &res);
+
+ done:
     if (res.hdr.flags & SYNC_FLAG_CHANNEL_SHUTDOWN) {
        FSYNC_Drop(fd);
     }
index c7bc09b..0edcb8c 100644 (file)
@@ -431,7 +431,10 @@ SALVSYNC_com(osi_socket fd)
     if (com.hdr.command == SYNC_COM_CHANNEL_CLOSE) {
        res.hdr.response = SYNC_OK;
        res.hdr.flags |= SYNC_FLAG_CHANNEL_SHUTDOWN;
-       goto respond;
+
+       /* don't respond, just drop; senders of SYNC_COM_CHANNEL_CLOSE
+        * never wait for a response. */
+       goto done;
     }
 
     if (com.recv_len != (sizeof(com.hdr) + sizeof(SALVSYNC_command_hdr))) {
@@ -479,6 +482,8 @@ SALVSYNC_com(osi_socket fd)
 
  respond:
     SYNC_putRes(&salvsync_server_state, fd, &res);
+
+ done:
     if (res.hdr.flags & SYNC_FLAG_CHANNEL_SHUTDOWN) {
        SALVSYNC_Drop(fd);
     }