-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dead lock may happens when byconity exit #1647
Comments
hi! @ArthurZou may i know which version are u using? and is there any ways to reproduce the bug or its purely depends on chances? It would help if can send us the error log as well. Thx! |
Byconity was built by commit 5cf3911. https://github.com/ByConity/libhdfs3-open/blob/33cc568a560a6d222a5f75aec90c7638b1314a3b/src/client/async_preader/StaticInitialization.cpp |
{
namespace AsyncCb
{
static boost::asio::io_context io_context;
boost::asio::io_context & AsioGlobalContext::Instance()
{
static AsioGlobalContext globalContextInitializer;
return io_context;
}
AsioGlobalContext::AsioGlobalContext()
{
// auto count = std::thread::hardware_concurrency() / 8;
auto count = std::thread::hardware_concurrency() ;
for (int i = 0; i < count; i++)
{
// the work guard here is used to keep run() away from returning when there is no work.
threads.emplace_back([&] {
std::string threadName = "hedge-read-" + std::to_string(i);
prctl(PR_SET_NAME,threadName.c_str(),0,0,0);
auto work = boost::asio::require(io_context.get_executor(), boost::asio::execution::outstanding_work.tracked);
io_context.run();
});
}
}
AsioGlobalContext::~AsioGlobalContext()
{
io_context.stop();
for (auto & th : threads)
{
if (th.joinable())
{
th.join();
}
}
}
}
LruMultiMap<std::string, PeerCache::value_type> PeerCache::Map;
LruMultiMap<std::string, PeerCache::value_type_async> PeerCache::MapAsync;
} The code is in StaticInitialization.cpp in libhdfs. It's pretty weird. AsioGlobalContext is inited after io_context so it should be deconstructed before io_context. but the log shows io_context is at least desconsturcted before the AsioGlobalContext |
here is the backtrace:
This is may caused by attempting to destroy a condition variable upon which other threads are currently blocked
The text was updated successfully, but these errors were encountered: