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

session pool memory leak #1655

Closed
AAAhs opened this issue Jun 26, 2022 · 3 comments · Fixed by #1657
Closed

session pool memory leak #1655

AAAhs opened this issue Jun 26, 2022 · 3 comments · Fixed by #1657
Assignees
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@AAAhs
Copy link
Contributor

AAAhs commented Jun 26, 2022

Environment

  • Node.js version: 12.22.6
  • npm version: 6.14.15
  • @google-cloud/spanner version: 6.0.0

Detail

I had investigated a memory leak in a project and found that the leak seems to be in the _getSession mehod of this client library.
image

Then I found that calling Promise.race with a long pending promise may lead to a memory leak. Please see here for details: nodejs/node#17469

I have tried to fix and verify this memory leak in the forked repository:
AAAhs@0554408

@AAAhs AAAhs added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jun 26, 2022
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/nodejs-spanner API. label Jun 26, 2022
@asthamohta
Copy link
Contributor

Thankyou @AAAhs for bringing this to our attention. Great find! Would it be possible to raise a PR from your fork to the nodejs library. If all the tests pass I am happy to merge this change

@AAAhs
Copy link
Contributor Author

AAAhs commented Jun 30, 2022

Hi @asthamohta , I've tried to fix it in this PR #1657, hope it would be helpful to solve this issue, all tests are passed, please review it, thanks for your time.

@asthamohta
Copy link
Contributor

Thanks @AAAhs, looks good to me but I would just like the core NodeJs team at google to review it once, that should happen this week. Then we can merge it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants