]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix boost::asio::async_write() does not return error... 35904/head
authorMark Kogan <mkogan@redhat.com>
Thu, 2 Jul 2020 16:37:43 +0000 (19:37 +0300)
committerMark Kogan <mkogan@redhat.com>
Thu, 9 Jul 2020 07:40:09 +0000 (10:40 +0300)
although remote has closed the connection

Fixes: https://tracker.ceph.com/issues/46332
Signed-off-by: Mark Kogan <mkogan@redhat.com>
src/rgw/rgw_asio_frontend.cc

index 5d0977336246f79d8e289928dd74447694787709..c8158db9eb3395ee8212a139af496e0eb6e85025 100644 (file)
@@ -69,6 +69,10 @@ class StreamIO : public rgw::asio::ClientIO {
                                           yield[ec]);
     if (ec) {
       ldout(cct, 4) << "write_data failed: " << ec.message() << dendl;
+      if (ec==boost::asio::error::broken_pipe) {
+        boost::system::error_code ec_ignored;
+        stream.lowest_layer().shutdown(tcp::socket::shutdown_both, ec_ignored);
+      }
       throw rgw::io::Exception(ec.value(), std::system_category());
     }
     return bytes;