Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix scope issue when setting thread names in the multi-threaded signature checker #1674

Merged

Conversation

wezrule
Copy link
Contributor

@wezrule wezrule commented Jan 31, 2019

There are some intermittent test failures (I could only reproduce them on a MAC), caused by a SIGABRT in the ~std::unique_ptr destructor. It seems that the mutex is going out of scope before the thread pool has fully finished. When the last promise.set_value () is called it notifies the main thread that the thread work is finished, and then exits the function (set_thread_names), but the threads haven't fully finished (i.e they still need to call destructors). I'm now (re)using the class member mutex so that it stays in the scope during this cleanup.

@wezrule wezrule added the bug label Jan 31, 2019
@wezrule wezrule added this to the V18.0 milestone Jan 31, 2019
@wezrule wezrule self-assigned this Jan 31, 2019
Copy link
Contributor

@cryptocode cryptocode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I get #cores - 1 signature checker threads now, I believe this was #cores the first time I tested this, but looks like this change was made a few commits ago.

@wezrule
Copy link
Contributor Author

wezrule commented Jan 31, 2019

Thanks! Yeh this was changed because the calling thread now does work, so num_threads is 'extra' threads doing work.

@wezrule wezrule merged commit 65b2584 into nanocurrency:master Jan 31, 2019
@wezrule wezrule deleted the fix_data_race_multithreaded_sig_checker branch January 31, 2019 21:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants