Skip to content
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

Unrelated Errors When Interrupting Single-Process Testing with SIGINT #359

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

MeditationDuck
Copy link
Member

Description

During testing—particularly fuzz testing with a single process—pressing Ctrl+C to send a SIGINT signal results in an error unrelated to the interruption. Instead of handling the SIGINT, the program displays a different error, often associated with a WebSocket.

Screenshot 2024-11-29 at 2 33 54

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 pressing Ctrl+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 to SIGINT.

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 the recv() operation, we ensure that data reception is not interrupted. Once the data has been fully received, any pending SIGINT 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

  • I clicked on "Allow edits from maintainers"

@michprev
Copy link
Member

michprev commented Dec 4, 2024

Seems working well, good job! 👍

@michprev michprev merged commit 932dacb into main Dec 4, 2024
10 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants