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

core/uwsgi: stop using pthread_cancel() #2627

Merged
merged 1 commit into from
Apr 7, 2024
Merged

Conversation

xrmx
Copy link
Collaborator

@xrmx xrmx commented Apr 7, 2024

When working to reproduce #2615 I saw many strange "defunct" (zombie) workers.
The master called waitpid(-1, ...) but it return 0 even there are some zombies.
Finally, master sends KILL signal (MERCY) and worker is restarted.

I believe this strange zombie was born from pthread_cancel. Subthreads calls pthread_cancel() for main thread and it cause strange process.

pthread_cancel() is very hard to use and debug. I can not even attach the strange zombie with gdb --pid. I think it is not maintainable.

In the end we can remove six_feet_under_lock and make wait_for_threads() static.

When working to reproduce unbit#2615 I saw many strange "defunct" (zombie)
workers.
The master called waitpid(-1, ...) but it return 0 even there are some
zombies.
Finally, master sends KILL signal (MERCY) and worker is restarted.

I believe this strange zombie was born from pthread_cancel. Subthreads
calls pthread_cancel() for main thread and it cause strange process.

pthread_cancel() is very hard to use and debug. I can not even attach the
strange zombie with gdb --pid. I think it is not maintainable.

In the end we can remove six_feet_under_lock and make wait_for_threads()
static.
@xrmx xrmx merged commit 207b91f into unbit:master Apr 7, 2024
31 checks passed
@xrmx xrmx mentioned this pull request Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants