-
Notifications
You must be signed in to change notification settings - Fork 208
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 CI for CUPS 2.5 #857
Fix CI for CUPS 2.5 #857
Conversation
@michaelrsweet linux tests probably passes on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
FWIW, I've still not been able to reproduce the hangs outside of the CI services, so there is something different about that environment... :/
Update remaining time after `usleep()`, otherwise there is no difference in elapsed time, so `remaining` will never be less or equal to 0. Fixes CI on Linux
Deadlock happens when we are about to destroy DNSSD struct by the end of `cups_enum_dests()`. The main thread locks the mutex when the other thread is in avahi poll callback at function `poll()` and unlocked the mutex before - the other thread tries to lock the mutex once poll timeout expires, but it cannot because it was locked by the main thread and wait there. Meanwhile the main thread tries to cancel the other thread, but the function where the other thread is not a cancellation point, thus the cancel event is ignored and the main thread thread waits indefinitely for the end of the other thread. We can make the other thread asynchronous (which would cancel the thread immediately) or release the mutex earlier in `cupsDNSSDDelete()`. The commit does the latter. Fixes CI for Linux
@michaelrsweet If you mean the hangs in Linux pipelines, one was directly connected to code with Avahi support, so you would need to build CUPS with Avahi, ideally in some Linux VM. And the deadlock happens basically due race condition, when the detached thread just unlocked the mutex and waits in I was thinking about the MacOS issue as well - we add |
@zdohnal I've been mostly doing my local Linux testing on Ubuntu, either in a VM of some sort (multipass and Parallels) or on my dedicated Linux laptop. Like I said, I wasn't able to make any of them fail, but then I always have network printers that show up for WRT mDNS on macOS, it is indeed mDNSResponder and that software will always be able to resolve the local hostname + .local, even when all external network interfaces are down (I've tested that to try to isolate the cause of the CI hang...) |
I found time to look why CI fails on Linux and came up with two fixes - for deadlock and infinite loop.