-
Notifications
You must be signed in to change notification settings - Fork 71
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
[4.0] Fix possible segfault switching between read/write windows #1719
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1389,20 +1389,12 @@ void producer_plugin::plugin_startup() | |
} FC_CAPTURE_AND_RETHROW() } | ||
|
||
void producer_plugin::plugin_shutdown() { | ||
try { | ||
my->_timer.cancel(); | ||
} catch ( const std::bad_alloc& ) { | ||
chain_plugin::handle_bad_alloc(); | ||
} catch ( const boost::interprocess::bad_alloc& ) { | ||
chain_plugin::handle_bad_alloc(); | ||
} catch(const fc::exception& e) { | ||
edump((e.to_detail_string())); | ||
} catch(const std::exception& e) { | ||
edump((fc::std_exception_wrapper::from_current_exception(e).to_detail_string())); | ||
} | ||
|
||
boost::system::error_code ec; | ||
my->_timer.cancel(ec); | ||
my->_ro_timer.cancel(ec); | ||
app().executor().stop(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain this line some more? In what cases would we make it here and the appbase executor would still be running? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The appbase executor is not running here. However, the read-only threads can still be running and some can be paused on the condition variable in |
||
my->_ro_thread_pool.stop(); | ||
my->_thread_pool.stop(); | ||
|
||
my->_unapplied_transactions.clear(); | ||
|
||
app().executor().post( 0, [me = my](){} ); // keep my pointer alive until queue is drained | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to change, but just to chat I would have written it like that.