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: fix a memory leak with autopipelining. #1470

Merged
merged 1 commit into from Nov 24, 2021

Conversation

TysonAndre
Copy link
Collaborator

@TysonAndre TysonAndre commented Nov 23, 2021

Set kCallbacks field to null instead of the empty array because nothing
should append to it until a new pipeline starts.
If anything did, that is a bug.

With Redis.Cluster, there could be 16384 different arrays pointing to
callbacks that aren't needed.

Memory impact probably isn't significant if those all point to Promises to resolve/reject,
though I guess the resolved data could itself be large in some cases

Set kCallbacks field to null instead of the empty array because nothing
should append to it until a new pipeline starts.
If anything did, that is a bug.

With Redis.Cluster, there could be 16384 different arrays pointing to
callbacks that aren't needed.
@luin luin changed the title Free autopipelining callbacks when they stop getting used. fix: fix a memory leak with autopipelining. Nov 24, 2021
@luin luin merged commit f5d8b73 into redis:master Nov 24, 2021
ioredis-robot pushed a commit that referenced this pull request Dec 1, 2021
## [4.28.2](v4.28.1...v4.28.2) (2021-12-01)

### Bug Fixes

* add Redis campaign ([#1475](#1475)) ([3f3d8e9](3f3d8e9))
* fix a memory leak with autopipelining. ([#1470](#1470)) ([f5d8b73](f5d8b73))
* unhandled Promise rejections in pipeline.exec [skip ci] ([#1466](#1466)) ([e5615da](e5615da))
@ioredis-robot
Copy link
Collaborator

🎉 This PR is included in version 4.28.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

janus-dev87 added a commit to janus-dev87/ioredis-work that referenced this pull request Mar 1, 2024
## [4.28.2](redis/ioredis@v4.28.1...v4.28.2) (2021-12-01)

### Bug Fixes

* add Redis campaign ([#1475](redis/ioredis#1475)) ([3f3d8e9](redis/ioredis@3f3d8e9))
* fix a memory leak with autopipelining. ([#1470](redis/ioredis#1470)) ([f5d8b73](redis/ioredis@f5d8b73))
* unhandled Promise rejections in pipeline.exec [skip ci] ([#1466](redis/ioredis#1466)) ([e5615da](redis/ioredis@e5615da))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants