On interrupt do not attempt to apply blocks #1063
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On shutdown the
interrupt_trx_test.py
sends a SIGTERM to all processes. The test timed out #1058 because the node was stuck trying to validate a block with an infinite transaction in it. The SIGTERM interrupted the block apply but there was a queued up process block which caused it to attempt theapply_block
again. The fix for this is actually in #1064 which added acheck_shutdown()
toshould_terminate()
. With thecheck_shutdown()
inshould_terminate()
, the node will check theapp().is_quitting()
before attempting to apply a block. This prevents it from attempting to apply a block that was interrupted via SIGTERM which sets theapp().is_quitting()
flag.Also added to the test a verification that head is advancing before verifying that LIB is advancing as a clearer indication that LIB is advancing after recovering from the interrupted block.
Resolves #1058