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

DrainingControl.isShutdown memory leak #1642

Closed
ilinandrii opened this issue Jun 16, 2023 · 1 comment
Closed

DrainingControl.isShutdown memory leak #1642

ilinandrii opened this issue Jun 16, 2023 · 1 comment
Labels
Milestone

Comments

@ilinandrii
Copy link

Versions used

2.0.5
master

Akka version:
2.5.32

Expected Behavior

Calls to DrainingControl.isShutdown method don't create additional future callbacks that occupy memory and in a long run for infinite streams lead to OOM

Actual Behavior

I'm using DrainingControl.isShutdown().isCompleted() for consumer health checks.
Health check calls lead to corresponding isShutdown calls on all running consumers, which in turn create new future callbacks with .flatMap.
The number of callbacks constantly growth and because all of my consumers are infinite streams those callbacks are never resolved and occupy heap until OOM is reached after a very long run.
I've workaround this by caching first call on isShutdown and calling isCompleted on returned future on each health check call, however it would be nice to have it fixed in a library.

@ennru ennru added the bug label Jun 26, 2023
@ennru
Copy link
Member

ennru commented Jun 26, 2023

Thank you for reporting this. Recreating the future should not be necessary and must be avoided.
Would you be in a position to suggest a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants