Commit 541ad43
committed
PYCBC-1813: Fix async txn callback leaks and add unraisable
Changes
--------
* Add complete_pending_operation() as the shared tail of every async
txn completion path, folding in handle_returning_void,
handle_returning_transaction_get_result,
handle_returning_transaction_get_multi_result,
handle_returning_query_result, and transaction_commit's inline
completion lambda; report a raised callback/errback via
PyErr_WriteUnraisable instead of dropping it silently
* Fix transaction_op's 7 early-return paths and its default: case to
Py_XDECREF the Py_XINCREF'd callback/errback before returning; the
default: case also now returns instead of falling through, which
previously hung the sync path on fut.get() waiting on a promise
nothing would set
* Fix the same leak in transaction_get_multi_op's analogous
unrecognized-op_type fallback
* Add PyErr_WriteUnraisable at the 5 remaining connection.cxx/
connection.hxx sites where a raised user callback/errback was
discarded unreported
Change-Id: I416d7e4319f41b338b7e335853734d8942a7d7d7
Reviewed-on: https://review.couchbase.org/c/couchbase-python-client/+/250600
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dimitris Christodoulou <dimitris.christodoulou@couchbase.com>1 parent 56f4fcb commit 541ad43
3 files changed
Lines changed: 112 additions & 142 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
| |||
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
135 | 143 | | |
136 | 144 | | |
137 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
265 | 269 | | |
266 | 270 | | |
267 | 271 | | |
268 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
269 | 278 | | |
270 | 279 | | |
271 | 280 | | |
| |||
703 | 712 | | |
704 | 713 | | |
705 | 714 | | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
706 | 719 | | |
707 | 720 | | |
708 | 721 | | |
| |||
0 commit comments