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

Modify exit handling to prevent test runner exit #730

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skyguy
Copy link

@skyguy skyguy commented Feb 22, 2025

These changes take another step towards easier testing of RNS:

The TERM signal handler is now set up in rnsd.py as it needs to run on the main thread - the previous location caused errors in test runners.
The INTR signal is now handled by rnsd - the finally clause will shutdown Reticulum.

All the exit methods are now together and use flags to prevent them from being executed multiple times.

The os._exit() call in RNS.exit() is also commented out to prevent RNS from killing the Python interpreter at unexpected times (e.g. during test runs). RNS.exit() seems to be called only from LocalInterface.teardown() and seems to shutdown OK without the os._exit() call in my testing, but I'm not able to test under Android.

-Kevin

Signed-off-by: Kevin Steen <code at kevinsteen.net>
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.

1 participant