Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

BoardRunner process crashes if any exception occurs #13

Open
kierdavis opened this issue Jul 25, 2017 · 2 comments
Open

BoardRunner process crashes if any exception occurs #13

kierdavis opened this issue Jul 25, 2017 · 2 comments

Comments

@kierdavis
Copy link
Member

If any unhandled exception occurs during BoardRunner.run, it will of course print a stacktrace and kill the subprocess, without calling make_safe.

A minimal solution to this would be to wrap the whole lot in a try block, with a finally: self.board.make_safe(). Even better, it could log the exception and attempt to continue running.

Note that currently exceptions can occur as a result of invalid input from the socket - for example, MotorBoard.command will throw a ValueError if any of the speed values are out of range. If this is the ideal response, then it is even more important that the BoardRunner be made resistant to exceptions.

This almost certainly applies to the master process (haven't checked though).

@prophile
Copy link
Collaborator

I'm not necessarily in favour of limping on in case of all exceptions.

Definite 👍 to not dying horribly when it's just a decoding issue from the control socket.
Definite 👍 to always calling mark_safe.

As to if it's actually thrown another exception, I think it might be better for the process to die and for the master process to re-start it?

@kierdavis
Copy link
Member Author

kierdavis commented Jul 27, 2017 via email

PeterJCLaw added a commit that referenced this issue Jan 31, 2018
As raised in #13, various
errors can happen during the course of 'run' and we should always
make sure that we make the boards safe before dying.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants