[python] Fix nightly-build failure / pybind11 exception-mapping#2963
Merged
[python] Fix nightly-build failure / pybind11 exception-mapping#2963
pybind11 exception-mapping#2963Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2963 +/- ##
==========================================
+ Coverage 89.89% 89.99% +0.09%
==========================================
Files 39 39
Lines 4049 4057 +8
==========================================
+ Hits 3640 3651 +11
+ Misses 409 406 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
nguyenv
approved these changes
Sep 6, 2024
8d1ab59 to
87177ab
Compare
87177ab to
f29a82c
Compare
This was referenced Sep 6, 2024
pybind11 exception-mapping
This was referenced Sep 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue and/or context: Resolves #2961
Changes:
Do explicit try-catch. See also #783.
Notes for Reviewer:
It's not necessarily causal that this triggered on https://github.com/jdblischak/centralized-tiledb-nightlies/issues/21. It's true that the
apis/python/tests/test_shape.pywas recently introduced on the #2407 stack. However, whether un-rethrown errors (on implicit pybind body, as in the "before" parts of this PR) reach the Python level astiledbsoma.SOMAErrororRuntimeErrorortiledb.cc.TileDBErrorhas some element of randomness.There's an attempt to globally register a rethrow:
https://github.com/single-cell-data/TileDB-SOMA/blob/1.13.1/apis/python/src/tiledbsoma/pytiledbsoma.cc#L36-L50
However, @nguyenv and I have long found that some things come through as
RuntimeErroron one machine, andtiledb.cc.TileDBErrorin another. We suspect that TileDB-Py's exception registrar has a race condition with our own.Regardless, a safe practice is explicit catch-and-rethrow at the boundary between C++ and Python, which is what we do more of here.