Fix race condition in async_driver#181
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #181 +/- ##
==========================================
- Coverage 80.93% 80.80% -0.14%
==========================================
Files 115 114 -1
Lines 2046 2037 -9
Branches 330 328 -2
==========================================
- Hits 1656 1646 -10
- Misses 256 257 +1
Partials 134 134
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
Is |
It turns out that the |
It can happen that the function executed by the
async_driverthrows an exception before the driver updates its state from "off" to "drive". When this happens, the state of the driver goes from "off" to "park" (due to the exception), and then to "drive". This is an error, and it causes a race condition. Instead, the states should go from "off" to "drive" (on the thread that invokes the driver function) to "park" (which can happen either due to normal completion or an exception).This PR implements this fix.