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

Fix resource leaks in AudioServlet #2959

Merged
merged 1 commit into from
May 16, 2022

Conversation

J-N-K
Copy link
Member

@J-N-K J-N-K commented May 13, 2022

Fixes #532

Add closing of streams on deactivation and add tests to ensure that all streams are closed after they are expired or retrieved.

There might be still one possible resource leak: a one-time stream that is served but never retrieved will stay in the map forever. But since that is exactly the wanted behavior for streams without timeout, there is nothing we can do about it. Those streams are only closed if the servlet is deactivated.

Signed-off-by: Jan N. Klug github@klug.nrw

Signed-off-by: Jan N. Klug <github@klug.nrw>
@J-N-K J-N-K added the bug An unexpected problem or unintended behavior of the Core label May 13, 2022
@J-N-K J-N-K requested a review from a team as a code owner May 13, 2022 17:16
@lolodomo
Copy link
Contributor

Code looks good to me.

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@kaikreuzer kaikreuzer added this to the 3.3 milestone May 16, 2022
@kaikreuzer kaikreuzer merged commit d523275 into openhab:main May 16, 2022
@J-N-K J-N-K deleted the bug-audiostreamsleak branch May 16, 2022 20:32
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
Signed-off-by: Jan N. Klug <github@klug.nrw>
GitOrigin-RevId: d523275
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resource leak: audio manager
3 participants