Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Work around potential Mono bug, that hangs the runtime when new threads start#1779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

lostmsu
Copy link
Member

@lostmsulostmsu commentedMay 2, 2022
edited
Loading

I suspect the issue is actually with Mono GC and the relatively new mode of suspending threads, which has a few (closed) bugs against it, complaining about hangs. In many of those bugs (you can find themhere) switching to the oldpreemptive mode works around the issue. I tried it for our tests, and it seems to solve it too.

The issue also vaguely mentioned inhttps://www.mono-project.com/docs/advanced/runtime/docs/coop-suspend/#thread-startfinish-still-bad

So the fix is to simply setMONO_THREADS_SUSPEND topreemptive in CI before running tests in Mono.

Fixes#1766

This workaround seems to solve the issue on my local machine as well as in CI. I did 5+ CI full matrix reruns to confirm. Before the fix a few MacOS legs would time out in every run.

Below is some history of finding this workaround.

filmor reacted with hooray emoji
@lostmsulostmsuforce-pushed thebugs/1766-MacOS-Test-Hang branch 2 times, most recently from88ecef6 to64a04d3CompareMay 2, 2022 18:40
@lostmsu
Copy link
MemberAuthor

lostmsu commentedMay 2, 2022
edited
Loading

:/ it does not fail when the blame mode is on indotnet test :/

On my own machine I was able to reproduce it on the first try, but then it never reproduced after that. :/

@lostmsu
Copy link
MemberAuthor

lostmsu commentedMay 2, 2022
edited
Loading

Looks like the issue may be with theTestThread function. Perhaps we are missing some synchronization there. I previously suspected that it needs memory barriers, because AFAIK acquiring GIL does not insert them. See this run passing on all MacOS versions with that method disabled:https://github.com/pythonnet/pythonnet/actions/runs/2260894105

@lostmsulostmsuforce-pushed thebugs/1766-MacOS-Test-Hang branch 3 times, most recently from854f20b to8d9d27eCompareMay 3, 2022 20:59
@lostmsulostmsuforce-pushed thebugs/1766-MacOS-Test-Hang branch from8d9d27e tof730963CompareMay 4, 2022 04:16
@lostmsulostmsu changed the titleWIP MacOS tests hangWork around potential Mono bug, that hangs the runtime when new threads startMay 4, 2022
@lostmsulostmsu requested a review fromfilmorMay 4, 2022 04:33
@lostmsulostmsu marked this pull request as ready for reviewMay 4, 2022 04:35
@filmor
Copy link
Member

This is probably also something that we should include in our docs.

@filmorfilmor merged commitbbfa252 intopythonnet:masterMay 4, 2022
@lostmsulostmsu mentioned this pull requestMay 4, 2022
@lostmsulostmsu deleted the bugs/1766-MacOS-Test-Hang branchMay 4, 2022 17:29
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@filmorfilmorAwaiting requested review from filmor

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Embedding tests randomly hang in MacOS
2 participants
@lostmsu@filmor

[8]ページ先頭

©2009-2025 Movatter.jp