-
Notifications
You must be signed in to change notification settings - Fork 4
watched_tasks: improve error handling in spawned tasks and threads #48
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
Conversation
|
The failed |
6cc296f to
9d9ceb8
Compare
|
Assigned to myself because #47 (which this is based on) still needs some work on my side. |
cf2851d to
61bfafe
Compare
|
Pull request #58 has changed the logic in |
ae48497 to
c14e10f
Compare
|
I've resolved the merge conflicts now and have also split the changes into a few more commits. |
Signed-off-by: Leonard Göhrs <[email protected]>
The operating system call to set the GPIO output state may fail. Make sure that this results in an orderly teardown of the tacd instead of a panic. This also necessitates a change to the test and demo_mode gpio stubs, so they can be `?`-operatored into anyhow Results (simply by making them anyhow results). Signed-off-by: Leonard Göhrs <[email protected]>
Since we can now return early from `wtb.spawn_thread`-spawned threads, because they handle error propagation out of the thread context for us we no longer have to use queues to send back error results manually. Use that to simplify error handling in the thread setup and the steady state. Signed-off-by: Leonard Göhrs <[email protected]>
Now that errors from threads are properly propagated we can simplify the error handling and do not have to transfer `Result`s across queues if something goes wrong during thread setup. Signed-off-by: Leonard Göhrs <[email protected]>
This PR adds some of the improved error handling that is hinted at in #47. For now that means:
src/dut_power.rssrc/adc/iio/hardware.rsTodo
[ ] Find even more places where error handling in tasks can be improvedWe can do that in subsequent PRs
Related Pull Requests
This PR is based on another PR that should be merged first: