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

Do Not Fork Dynamically Accessed Scope #8355

Merged
merged 1 commit into from Sep 15, 2023
Merged

Conversation

adamgfraser
Copy link
Contributor

Resolves #8353.

We should not create a scope child scope of a scope that we do not know statically is contained in the environment because we might add a scope that was added at a much higher level of the application and leak if we repeatedly add children to this scope.

@narma
Copy link
Contributor

narma commented Aug 25, 2023

Why were the tests removed?

@adamgfraser
Copy link
Contributor Author

Because we can't add child scopes to a scope that we don't know statically exists.

@myazinn
Copy link
Contributor

myazinn commented Sep 5, 2023

Hi
Any updates on this fix?🥲

@adamgfraser
Copy link
Contributor Author

@myazinn You can see the updates for yourself here. 😃

@ghostdogpr
Copy link
Member

Any chance to get this merged? I got hit by the memory leak in production, not using ZLayer as in the initial issue but using ZQuery#zipPar which is relying on ZIO#zipWithPar, in a fiber that never terminates. Thanks in advance 😄 🙏

@jdegoes jdegoes merged commit 0614b38 into zio:series/2.x Sep 15, 2023
22 checks passed
@adamgfraser adamgfraser deleted the 8353 branch September 18, 2023 13:57
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.

ZIO 2.0.16 ZLayer#zipWithPar causes memory leak
5 participants