Unrelated Errors When Interrupting Single-Process Testing with SIGINT #359
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.
Description
During testing—particularly fuzz testing with a single process—pressing
Ctrl+C
to send aSIGINT
signal results in an error unrelated to the interruption. Instead of handling theSIGINT
, the program displays a different error, often associated with a WebSocket.The root cause of this issue is that when the system is testing, it sends transactions to Anvil (used here as an example) and waits to receive data back. If the user sends a
SIGINT
(by pressingCtrl+C
) while the program is waiting for data (recv()
), the receive operation is canceled. The program then proceeds to finalize the chain interfaces, which involves further communication with Anvil. However, due to the canceled receive operation, the finalization process may receive unexpected data or residual responses from the previous operation. This results in an unexpected error during finalization, which is reported to the user instead of the expected interruption due toSIGINT
.Fix
To address this issue, the code has been modified to prevent interruptions during data reception from the chain. By temporarily suppressing
SIGINT
signals during therecv()
operation, we ensure that data reception is not interrupted. Once the data has been fully received, any pendingSIGINT
is then processed. This allows the program to handle the interruption appropriately after ensuring the data integrity during communication with Anvil.This change does not cause much overhead in the testing.
with fix
89.28
92.31
97.42
without fix
88.22
96.62
89.11