FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[pull] master from pythonnet:master by pull[bot] · Pull Request #55 · QSLee-Net/pythonnet · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) .yml  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:

env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
# Apply to every Mono host, including pytest and the .NET Python test runner.
MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466
steps:
- name: Checkout code
uses: actions/checkout@v7
Expand Down Expand Up @@ -84,8 +86,6 @@ jobs:
- name: Embedding tests (Mono/.NET Framework)
if: always()
run: dotnet test --runtime any-${{ matrix.os.platform }} --framework net472 --logger "console;verbosity=detailed" src/embed_tests/
env:
MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466

- name: Embedding tests (.NET Core)
if: always()
Expand All @@ -97,7 +97,7 @@ jobs:

- name: Python Tests (Mono)
if: always()
run: pytest --runtime mono
run: uv run pytest --runtime mono -v -o faulthandler_timeout=60

- name: Python Tests (.NET Framework)
if: ${{ matrix.os.category == 'windows' }}
Expand Down
14 changes: 14 additions & 0 deletions doc/source/threading.rst
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ Forgetting this is the most common pythonnet threading bug. Symptoms range
from immediate segfaults to subtle refcount corruption that crashes much
later.

Mono thread suspension
----------------------

On Linux and macOS, Mono's cooperative/hybrid thread suspension can hang
when Python and managed threads interact. If affected, set
``MONO_THREADS_SUSPEND=preemptive`` before starting the process, as described
in `mono/mono#21466 <https://github.com/mono/mono/issues/21466>`_.
CI uses this workaround for both embedding and Python-hosted tests.

To run the Mono Python tests with per-test output and a Python thread
stack dump if a test takes longer than 60 seconds::

MONO_THREADS_SUSPEND=preemptive uv run pytest --runtime mono -v -o faulthandler_timeout=60

Reference counting and finalizers
---------------------------------

Expand Down
Loading

Back | FazBrowse Home | New Git URL