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

darwin: workaround apple pthread_cond_wait bug #4166

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

vbfox
Copy link
Contributor

@vbfox vbfox commented Oct 11, 2023

Under heavy workloads pthread_cond_wait on macOS can return EINVAL while all the input parameters are correct.

As it happens due to a syscall having an errno of EBUSY we can detect it and workaround it.

Fixes #4165

src/unix/thread.c Outdated Show resolved Hide resolved
@vbfox vbfox force-pushed the macos_uv_cond_wait_ebusy branch from 1f45d1c to 561461b Compare October 13, 2023 07:46
Under heavy workloads pthread_cond_wait on macOS can return EINVAL while
all the input parameters are correct.

As it happens due to a syscall having an errno of EBUSY we can detect it
and workaround it.

Fixes libuv#4165
@vbfox vbfox force-pushed the macos_uv_cond_wait_ebusy branch from 561461b to 63092ca Compare October 13, 2023 13:06
@vbfox
Copy link
Contributor Author

vbfox commented Oct 13, 2023

Pushed a new version with style changes, opening the PR as it has been deployed in our production for a few days and is stable.

@vbfox vbfox marked this pull request as ready for review October 13, 2023 13:17
@vbfox vbfox requested a review from bnoordhuis October 13, 2023 13:17
src/unix/thread.c Outdated Show resolved Hide resolved
@bnoordhuis bnoordhuis merged commit 197f453 into libuv:v1.x Oct 13, 2023
24 checks passed
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.

darwin: uv_cond_wait abort due to apple bug
2 participants