Skip to content

Commit

Permalink
Merge pull request #845 from AntelopeIO/GH-822-ship-hang
Browse files Browse the repository at this point in the history
[1.0.2] SHiP: Fix hang on exit
  • Loading branch information
heifner authored Oct 1, 2024
2 parents 2bce486 + f8abec4 commit 4648fba
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 4648fba

Please sign in to comment.