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

Don't call rx.next after receiving None, fixes #27 #28

Merged
merged 1 commit into from
Sep 28, 2020

Conversation

payload
Copy link
Contributor

@payload payload commented Sep 27, 2020

In case the channel is dropped, rx.next will return None once.
After that we must not call rx.next or else it will remind us
by panicking. Instead we leave now the restart loop, since
the channel is broken and restarting the actor won't help it.
The supervisor calls a last time .stopped on the actor and
supervising ends.

Unfortunately the doc test does not catch this errornous behaviour
since the panic happens in another thread. The main process still
exits with code 0. We only see the panic through lines on the
terminal.

fixes #27

In case the channel is dropped, rx.next will return None once.
After that we must not call rx.next or else it will remind us
by panicking. Instead we leave now the restart loop, since
the channel is broken and restarting the actor won't help it.
The supervisor calls a last time .stopped on the actor and
supervising ends.

Unfortunately the doc test does not catch this errornous behaviour
since the panic happens in another thread. The main process still
exits with code 0. We only see the panic through lines on the
terminal.
@sunli829
Copy link
Owner

Thank you! 😁

@sunli829 sunli829 merged commit f36533d into sunli829:master Sep 28, 2020
@payload
Copy link
Contributor Author

payload commented Sep 28, 2020

Do you know how to tackle the issue that the tests don't catch panics from the thread pool?

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.

Supervisors cannot be stopped (formerly "Supervisor causes panic")
2 participants