Merge pull request #35904 from mkogan1/wip-fix-endpoint-not-connected-r2

rgw: fix boost::asio::async_write() does not return error...

Reviewed-by: Matt Benjamin <mbenjamin@redhat.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
J. Eric Ivancich 2020-07-09 22:51:47 -04:00 committed by GitHub
commit c757bc862d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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;