Commit 0fec53a
committed
PYCBC-1798: Fix dealloc_transactions leak and GIL-held close
* Delete the heap-allocated transactions wrapper on capsule destroy;
it was previously never freed, leaking the whole C++ transactions
runtime on every teardown
* Release the GIL around the txns->close() and delete txns calls, so a
pending IO-thread callback can't deadlock waiting to reacquire it
* Free the same wrapper when PyCapsule_New fails in create_transactions;
with no capsule the destructor is never registered, so the core
cleanup threads it owns would otherwise run for the life of the
process
Change-Id: I87d4014122bf5b745ce157b0c73b359bbfa8e44d
Reviewed-on: https://review.couchbase.org/c/couchbase-python-client/+/249285
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Build Bot <build@couchbase.com>1 parent 971195b commit 0fec53a
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
630 | 638 | | |
631 | 639 | | |
632 | 640 | | |
| |||
0 commit comments