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

AudioRedWorker guaranteed to leak after terminating a call #2956

Closed
4 tasks done
issacgerges opened this issue Sep 13, 2024 · 2 comments
Closed
4 tasks done

AudioRedWorker guaranteed to leak after terminating a call #2956

issacgerges opened this issue Sep 13, 2024 · 2 comments
Labels
audio Issues related to impaired audio experience - quality related or not being able to get audio Bug Something isn't working Triaged

Comments

@issacgerges
Copy link

issacgerges commented Sep 13, 2024

What happened and what did you expect to happen?

When terminating a call when audioRed was enabled, the this.audioRedWorker reference is cleaned up, but the worker isn't explicitly terminated. This means the worker will live on for the length of the session, retaining some memory

image

The following should call this.audoRedWorker.terminate() before removing the reference via this.audioRedWorker = null;

private destroyAudioRedWorkerAndStates(): void {
if (this.audioRedWorker) {
URL.revokeObjectURL(this.audioRedWorkerURL);
this.audioRedWorkerURL = null;
this.audioRedWorker = null;
this.currentNumRedundantEncodings = 0;
this.lastRedHolddownTimerStartTimestampMs = 0;
this.lastAudioRedTurnOffTimestampMs = 0;
this.lastHighPacketLossEventTimestampMs = 0;
this.audioRedEnabled = true;
/* istanbul ignore next */
this.meetingSessionContext?.audioVideoController.removeObserver(this);
/* istanbul ignore next */
this.removeRedundantAudioRecoveryMetricsObserver(this.meetingSessionContext?.statsCollector);
}
}

Have you reviewed our existing documentation?

Reproduction steps

Create a call with audioRed enabled and end it and see the worker global scopes retained

Amazon Chime SDK for JavaScript version

3.23.0

What browsers are you seeing the problem on?

Chromium

Browser version

128.0.6613.120

Meeting and Attendee ID Information.

No response

Browser console logs

n/a

@hensmi-amazon
Copy link
Contributor

Made change recommended in #2960, thanks!

@ltrung
Copy link
Contributor

ltrung commented Nov 1, 2024

Fix has been merged. Closing for now.

@ltrung ltrung closed this as completed Nov 1, 2024
@ltrung ltrung added the audio Issues related to impaired audio experience - quality related or not being able to get audio label Nov 1, 2024
@dylonChime dylonChime added Triaged Bug Something isn't working labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio Issues related to impaired audio experience - quality related or not being able to get audio Bug Something isn't working Triaged
Projects
None yet
Development

No branches or pull requests

4 participants