BoardRunner process crashes if any exception occurs
kierdavis opened this issue ยท 2 comments
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).
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?