Skip to content

Fixed hanging for NApp exception#602

Merged
Alopalao merged 3 commits intomasterfrom
fix/napp_exception
Jan 29, 2026
Merged

Fixed hanging for NApp exception#602
Alopalao merged 3 commits intomasterfrom
fix/napp_exception

Conversation

@Alopalao
Copy link
Copy Markdown

Closes #601

Summary

Starting controller after adding the signals.

Local Tests

Excercise this PR with wrong values in settings.py so mef_eline would failed start.

End-to-End Tests

N/A

@Alopalao Alopalao requested a review from a team as a code owner January 26, 2026 22:04
Copy link
Copy Markdown
Member

@viniarck viniarck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix @Alopalao, it's in the right direction but it's caused other issues. start_shell_async has to run after controller.start() coro, otherwise it'll crash due to server attrs dependency it access, and the shell won't start correctly:

shell_task: <Task finished name='Task-1' coro=<start_shell_async() done, defined at /home/viniarck/repos/kytos/kytos/core/kytosd.py:136> exception=AttributeError("'NoneType' object has no attribute 'server_address'")>

Try moving shell_task after controller.start(), and then make sure to explore all the related cases that you've been fixing and exploring

@Alopalao
Copy link
Copy Markdown
Author

I misunderstood the use of sys.exit(). SystemExit was catching the raise not the signals. Now it runs as expected.

  • I also tried to start controller inside create_task() instead of run_until_complete but the exiting was printing the reason of the crash.
  • Also tried separating dependency from the shell to obtain adress and port from controller.options instead of the server. But, after exercising the crash, this was leaving any terminal not able to show any input. (Input was not showing as in password masking or input hiding in console)

Copy link
Copy Markdown
Member

@viniarck viniarck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done @Alopalao, really great to have this regression fixed.

Before merging, check out the linter error.

After you fix it, go ahead and merge into master.

@Alopalao Alopalao merged commit 4e0d10b into master Jan 29, 2026
2 checks passed
@Alopalao Alopalao deleted the fix/napp_exception branch January 29, 2026 18:26
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.

If a NApp fails startup, kytos hangs

2 participants