]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: beast frontend logs socket errors at level 4
authorCasey Bodley <cbodley@redhat.com>
Fri, 19 Oct 2018 14:25:24 +0000 (10:25 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 19 Oct 2018 14:25:26 +0000 (10:25 -0400)
these errors are frequent (clients disconnecting, or sockets closed on
shutdown), and are handled gracefully in general

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_asio_frontend.cc

index 5b51cf927048eb8972789ae2cce62ed88d427ef8..6675448cb596ae4612e447c133d6b0b12168422f 100644 (file)
@@ -31,22 +31,23 @@ namespace ssl = boost::asio::ssl;
 
 template <typename Stream>
 class StreamIO : public rgw::asio::ClientIO {
+  CephContext* const cct;
   Stream& stream;
   beast::flat_buffer& buffer;
  public:
-  StreamIO(Stream& stream, rgw::asio::parser_type& parser,
+  StreamIO(CephContext *cct, Stream& stream, rgw::asio::parser_type& parser,
            beast::flat_buffer& buffer, bool is_ssl,
            const tcp::endpoint& local_endpoint,
            const tcp::endpoint& remote_endpoint)
       : ClientIO(parser, is_ssl, local_endpoint, remote_endpoint),
-        stream(stream), buffer(buffer)
+        cct(cct), stream(stream), buffer(buffer)
   {}
 
   size_t write_data(const char* buf, size_t len) override {
     boost::system::error_code ec;
     auto bytes = boost::asio::write(stream, boost::asio::buffer(buf, len), ec);
     if (ec) {
-      derr << "write_data failed: " << ec.message() << dendl;
+      ldout(cct, 4) << "write_data failed: " << ec.message() << dendl;
       throw rgw::io::Exception(ec.value(), std::system_category());
     }
     return bytes;
@@ -66,7 +67,7 @@ class StreamIO : public rgw::asio::ClientIO {
         break;
       }
       if (ec) {
-        derr << "failed to read body: " << ec.message() << dendl;
+        ldout(cct, 4) << "failed to read body: " << ec.message() << dendl;
         throw rgw::io::Exception(ec.value(), std::system_category());
       }
     }
@@ -137,7 +138,7 @@ void handle_connection(RGWProcessEnv& env, Stream& stream,
       RGWRequest req{env.store->get_new_req_id()};
 
       auto& socket = stream.lowest_layer();
-      StreamIO real_client{stream, parser, buffer, is_ssl,
+      StreamIO real_client{cct, stream, parser, buffer, is_ssl,
                            socket.local_endpoint(),
                            socket.remote_endpoint()};