Commit Graph

4 Commits

Author SHA1 Message Date
Michael Hudson-Doyle de18cc977f make SingleInstanceTask.start_sync set self.task synchronously 2019-12-16 12:33:19 +13:00
Michael Hudson-Doyle fe08311c19 stop block probing failures from crashing the process
There is a common problem in concurrent / asynchronous code of what to
do with unhandled exceptions. If a (conceptual) thread of execution
fails, there's no guarantee (and no way of telling) if there's anything
listening.  By default, I chose to have a failing task propagate the
exception up to the run loop for two reasons:

 1) Unhandled exceptions are generally bad
 2) urwid.ExitMainLoop needs to be propagated to the run loop to have
    any effect

But this means that tasks that are expected to fail (and have this
failure handled) like block probing crash the process, which is
obviously a Bad Thing. This branch adds a way to turn off exception
propagation per-task, which is a bit hackish but works ok it seems.
2019-12-15 09:45:14 +13:00
Michael Hudson-Doyle 992e131b5f squash all exceptions when cancelling the task in SingleInstanceTask
otherwise restarting a failed task just raises the exception from the previous
failure
2019-12-13 10:05:23 +13:00
Michael Hudson-Doyle 08e081415d move async_helpers to subiquitycore 2019-12-13 10:04:02 +13:00