]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common: do not print error when asok is closed
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 17 Mar 2017 17:05:55 +0000 (13:05 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 17 Mar 2017 17:07:40 +0000 (13:07 -0400)
If the admin socket is closed without sending a command, we get stderr messages like:

    ceph-mds[17174]: 2017-03-16 02:30:06.240322 7f40c7e44700 -1 asok(0x561abb4d4000) AdminSocket: error reading request code: (0) Success

If the socket is closed on the other end, just return.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/common/admin_socket.cc

index bc1feec69c31cdc6a0fb151031d1c296bdb1b9cd..36e198cb7bf5df9f83d05d669f97fd5a4101917e 100644 (file)
@@ -320,8 +320,10 @@ bool AdminSocket::do_accept()
   while (1) {
     int ret = safe_read(connection_fd, &cmd[pos], 1);
     if (ret <= 0) {
-      lderr(m_cct) << "AdminSocket: error reading request code: "
-                  << cpp_strerror(ret) << dendl;
+      if (ret < 0) {
+        lderr(m_cct) << "AdminSocket: error reading request code: "
+                    << cpp_strerror(ret) << dendl;
+      }
       VOID_TEMP_FAILURE_RETRY(close(connection_fd));
       return false;
     }