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

Correctly shutdown all scheduler threads #4549

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

SeanTAllen
Copy link
Member

Prior to this change, it was possible to not shutdown all scheduler threads. ponyint_thread_join on non-Windows systems calls pthread_join. pthread_join can fail and that failure needs to be handled. In our case here, given that ponyint_thread_join returns a boolean, the response to an error is to try again.

If we encounter a non-recoverable error, this new strategy should result in a hang rather than undefined behavior. If we have hangs that we trace to this changed functionality, we look at more robust error handling and changing the interface from ponyint_thread_join.

Prior to this change, it was possible to not shutdown all scheduler
threads. ponyint_thread_join on non-Windows systems calls pthread_join.
pthread_join can fail and that failure needs to be handled. In our case
here, given that ponyint_thread_join returns a boolean, the response to
an error is to try again.

If we encounter a non-recoverable error, this new strategy should result
in a hang rather than undefined behavior. If we have hangs that we trace
to this changed functionality, we look at more robust error handling and
changing the interface from ponyint_thread_join.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Nov 25, 2024
@SeanTAllen SeanTAllen merged commit e7e29b0 into main Nov 26, 2024
26 checks passed
@SeanTAllen SeanTAllen deleted the handle-scheduler-shutdown-failure branch November 26, 2024 19:43
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Nov 26, 2024
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