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

Open
4 tasks done
issacgerges opened this issue Sep 13, 2024 · 1 comment
Open
4 tasks done

AudioRedWorker guaranteed to leak after terminating a call #2956

issacgerges opened this issue Sep 13, 2024 · 1 comment

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!

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

No branches or pull requests

2 participants