Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible hangs in the CFRunLoop driver #193

Merged
merged 1 commit into from
Aug 24, 2021
Merged

Conversation

s-ludwig
Copy link
Member

No description provided.

@s-ludwig s-ludwig requested a review from l-kramer August 23, 2021 13:22
//
// NOTE: In contrast to Apple's documentation, kCFRunLoopRunStopped is
// returned not only if the loop is explicitly stopped, but also
// after handling events normalls. For this reason we treat any
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Normally

@Geod24
Copy link
Contributor

Geod24 commented Aug 23, 2021

Failed the relevant job (cfrunloop), I re-triggered to see if it's spurious:

Running ../../../../../var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/.dub/build/test-~master/application-debug-posix.osx-x86_64-ldc_2087-57DFF3775D97BABB28C115198F1D2C23/test 
core.exception.AssertError@tests/issue-25-periodic-timers.d(48): 101 ms, 657 μs, and 6 hnsecs
----------------
??:? _d_assert_msg [0x105074796]
issue-25-periodic-timers.d:48 nothrow @safe void test.main().periodicCallback(eventcore.driver.TimerID) [0x104eb4a61]
driver.d:717 nothrow @safe void eventcore.driver.EventDriverTimers.wait(eventcore.driver.TimerID, void delegate(eventcore.driver.TimerID) nothrow @safe).__lambda3!(eventcore.driver.TimerID, bool).__lambda3(eventcore.driver.TimerID, bool) [0x104ec9de6]
timer.d:80 nothrow @safe int eventcore.drivers.timer.LoopTimeoutTimerDriver.process(core.time.MonoTimeImpl!(0).MonoTimeImpl).__foreachbody3(ref eventcore.drivers.timer.TimerSlot*) [0x104f0df14]

I'm seeing zombies when running locally and Ctrl+Cing, could this be why ?

@s-ludwig
Copy link
Member Author

I'm seeing zombies when running locally and Ctrl+Cing, could this be why ?

I unfortunately couldn't reproduce the zombies or the timer test failure locally - neither with the current LDC, nor with 1.17.0. However, the same failure has occurred for a lot of commits on master in the past, always with LDC 1.17.0 or 1.16.0, so I think we can safely ignore it for this PR. There seems to be something with the macOS VMs that generally results in very imprecise timing.

@Geod24
Copy link
Contributor

Geod24 commented Aug 24, 2021

I don't think the bug I'm seeing is related to the LDC version, as I'm seeing it with the latest. So the CI failure is probably a different thing.
In any case, since you are looking at CFRunLoop, I created an issue which reproduces the problem: vibe-d/vibe.d#2596

@s-ludwig s-ludwig merged commit 0eae6b0 into master Aug 24, 2021
@s-ludwig s-ludwig deleted the cfrunloop_hang_fix branch August 24, 2021 09:50
@s-ludwig
Copy link
Member Author

Opened a PR for the shutdown issue: vibe-d/vibe-core#292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants