Skip to content

Commit

Permalink
Merge pull request #5932
Browse files Browse the repository at this point in the history
f3b65c6 Request a thread stack size that is large enough for unbound (omartijn)
  • Loading branch information
luigi1111 committed Oct 8, 2019
2 parents 577b060 + f3b65c6 commit b0840a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/p2p/net_node.inl
Expand Up @@ -670,11 +670,18 @@ namespace nodetool
std::vector<std::vector<std::string>> dns_results;
dns_results.resize(m_seed_nodes_list.size());

// some libc implementation provide only a very small stack
// for threads, e.g. musl only gives +- 80kb, which is not
// enough to do a resolve with unbound. we request a stack
// of 1 mb, which should be plenty
boost::thread::attributes thread_attributes;
thread_attributes.set_stack_size(1024*1024);

std::list<boost::thread> dns_threads;
uint64_t result_index = 0;
for (const std::string& addr_str : m_seed_nodes_list)
{
boost::thread th = boost::thread([=, &dns_results, &addr_str]
boost::thread th = boost::thread(thread_attributes, [=, &dns_results, &addr_str]
{
MDEBUG("dns_threads[" << result_index << "] created for: " << addr_str);
// TODO: care about dnssec avail/valid
Expand Down

0 comments on commit b0840a8

Please sign in to comment.