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

Make global EpollRuntime independent of IORuntime #44

Merged
merged 4 commits into from
Sep 11, 2022
Merged

Conversation

armanbilge
Copy link
Owner

This fixes an issue where EpollApps were hanging upon the first async I/O op.

The problem was, unbeknownst to me, if you override the runtime in an IOApp it does not get installed as IORuntime.global. Because EpollRuntime.global was working in terms of IORuntime.global, this was causing two EpollRuntimes to be created, with I/O callbacks registered on the the second one not used by the EpollApp. Thus, the hang.

The fix is to just make the EpollRuntime.global completely independent of IORuntime.global. There is a bit of a footgun here, since two runtimes cannot coexist in a meaningful way, but I am following the Cats Effect design choice that an overridden runtime should not replace its own global runtime.

To explore this issue I created an example app and reorganized some of the test scaffolds. The example app is now run as part of the CI workflow.

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.

1 participant