mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-20 01:32:21 -05:00
So, it turns out that if you have a first `Deferred` `D1`, you can add a callback which returns another `Deferred` `D2`, and `D2` must then complete before any further callbacks on `D1` will execute (and later callbacks on `D1` get the *result* of `D2` rather than `D2` itself). So, `D1` might have `called=True` (as in, it has started running its callbacks), but any new callbacks added to `D1` won't get run until `D2` completes - so if you `yield D1` in an `inlineCallbacks` function, your `yield` will 'block'. In conclusion: some of our assumptions in `logcontext` were invalid. We need to make sure that we don't optimise out the logcontext juggling when this situation happens. Fortunately, it is easy to detect by checking `D1.paused`. |
||
|---|---|---|
| .. | ||
| api | ||
| appservice | ||
| config | ||
| crypto | ||
| events | ||
| handlers | ||
| metrics | ||
| replication | ||
| rest | ||
| storage | ||
| util | ||
| __init__.py | ||
| test_distributor.py | ||
| test_dns.py | ||
| test_preview.py | ||
| test_state.py | ||
| test_test_utils.py | ||
| test_types.py | ||
| unittest.py | ||
| utils.py | ||