Skip to content
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

[1.0.2 -> main] SHiP: Fix hang on exit #852

Merged
merged 5 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions plugins/state_history_plugin/state_history_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,16 @@ void state_history_plugin_impl::plugin_shutdown() {
accepted_block_connection.reset();
block_start_connection.reset();
thread_pool.stop();

// This is a temporary fix until https://github.com/AntelopeIO/spring/issues/842 can be worked.
// Drain the io_service of anything that could be referencing state_history_plugin
if (app().executor().get_io_service().stopped()) {
app().executor().get_io_service().restart();
while (app().executor().get_io_service().poll())
;
// clear priority queue of anything pushed by poll(), see application_base exec()
app().executor().clear();
}
}

void state_history_plugin::plugin_shutdown() {
Expand Down