You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PYCBC-1820: Add C++ exception boundaries at extension entry points
Changes
--------
* Wrap execute_multi_op's body in try/catch(const std::exception&),
matching execute_kv_op's existing shape, so a throw from
py_to_cbpp (e.g. invalid-UTF-8 bucket/scope/collection/key) can't
unwind uncaught into CPython
* Convert every Py_BEGIN/END_ALLOW_THREADS pair in transactions.cxx
(21 across the 9 module-level entry points plus
dealloc_transactions) to pycbc::gil_release_guard, and wrap each in
try/catch: the guard restores the GIL during unwind before the
catch runs, which the bare macro pair doesn't
* Dispatch-call failures raise_invalid_argument after releasing any
already-incref'd callback/errback refs; sync fut.get() failures
use set_runtime_error_if_unset; dealloc_transactions logs and
swallows, since a dealloc can't propagate an exception
* Fix create_transaction_context leaking py_ctx on a PyCapsule_New
failure, found while adding its boundary
Change-Id: Ia575112e0b59ec2139151a86ae247eadf913cbee
Reviewed-on: https://review.couchbase.org/c/couchbase-python-client/+/250614
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dimitris Christodoulou <dimitris.christodoulou@couchbase.com>
0 commit comments