Closed mhils closed 1 year ago
Race condition indeed - @decathorpe was slightly faster than me in #78. 🫣 Please feel free to merge whatever you prefer, no hard feelings at all.
Merged #78 and released it as 0.17 along with a regression test. Let me know if you see any issues downstream!
This PR fixes the race condition described in #77: Python's runtime could previously set a Future's result between pyo3-ayncio's
cancelled
check and itsset_result
callback, causing anInvalidStateException
. This PR fixes this by doing the check immediately before setting the result.Adding tests is tricky as we heavily rely on a race condition between the two runtimes, so I've skipped that. Lastly, the PR template mentions a CHANGELOG.md, but there is no such file. :)
Apart from these details,
pyo3-asyncio
has been fantastic to work with. Thank you very much for the work you're doing here! 😃🍰✨