Closed LeonardBesson closed 2 years ago
@jochemb I think all comments are addressed, and I've added a test for the nested case.
@OpsBotPrime merge
Pull request approved for merge by @LeonardBesson, rebasing now.
Rebased as 995f0400405f9f1b39320f2f751da780527ee059, waiting for CI …
Currently, the retry state namespaces leak between asyncio tasks or threads. This is important in concurrent code where the retry states should not affect others. For example it might make sense to disable retries under certain conditions (I also added an utility for this)
This PR adds
contexvars
when usable (>= 3.7) which prevent these leaks.