Skip to content

haf!#138 fix for hang when applyaing block last to long during application is closing

Ensure the loop empties the write queue when the application is closing. When the application is closing, the P2P plugin relies on the shutdown_mgr::wait method to process all the blocks it pushed to the queue before exiting. In cases where processing a block takes too long and the application is in the process of closing (not running), the remaining blocks in the queue must be processed by the 'req_visitor' in order to release the pending shutdown_mgr::wait. The blocks themselves will not be modified, as the visitor's 'visit' method immediately returns when a closing is pending. Instead, only the promises associated with the blocks will be triggered, advancing the shutdown_mgr::wait process. Without this mechanism, the application would hang while waiting for processing all the blocks in the queue.

Merge request reports