Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Libhdfs++ can work itself into a state where it needs to shutdown, in this case due to config issues, and during deconstruction attempts to call shutdown() and close() on an asio::tcp::socket that was never opened. This causes asio to throw a std::system_error which ends up terminating the process. See attached stack for details.
The fix is just to make sure the rpc_connection is actually connected before attempting to close it.
- next_layer_.cancel(); - next_layer_.close(); + if(connected_) { + next_layer_.cancel(); + next_layer_.close(); + } connected_ = false;