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

Use Process._fork hook to handle dispatcher thread cleanup logic #386

Open
pedro-stanaka opened this issue Oct 29, 2024 · 0 comments
Open
Assignees

Comments

@pedro-stanaka
Copy link
Contributor

pedro-stanaka commented Oct 29, 2024

Summary

In Ruby 3.1 we introduced the Process._fork (see PR), which was targeted at the specific use case that we have in the library, where we need to keep track of fork() calls and properly handle state cleaning/flushing on dispatcher threads.

We should replace the complex logic for handling dispatcher threads in both the Aggregator and the BatchedSink with those hooks. If possible, create some kind of cross cutting module that uses some kind of Pub/Sub architecture to let the interested components know a fork happened.

Caveats

Note that since that is a feature from Ruby 3.1 we would have to drop support for Ruby < 3.1. But that should not be a problem since, at the time of this writing, 3.0 is EOL (April 2024) and 3.4 is on the verge of going GA.

Relates to #384

@pedro-stanaka pedro-stanaka self-assigned this Nov 4, 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

No branches or pull requests

1 participant