Skip to content

Conversation

@trentm
Copy link
Member

@trentm trentm commented Feb 10, 2022

tl;dr: Use a WeakMap as a WeakMap, not as an Object.
This leak was introduced in #2484.

Fixes: #2569

Checklist

  • Implement code
  • Add CHANGELOG.asciidoc entry
  • Commit message follows commit guidelines

@trentm trentm self-assigned this Feb 10, 2022
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Feb 10, 2022
const currSpan = ins.currSpan()
if (currSpan) {
diagResultFromSpan[currSpan] = result
diagResultFromSpan.set(currSpan, result)
Copy link
Member Author

Choose a reason for hiding this comment

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

:embarrassment:

Copy link
Contributor

Choose a reason for hiding this comment

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

it got by my review too so sign me up for the :embarrassment: newsletter.

Copy link
Member

Choose a reason for hiding this comment

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

Wow, that's a pitfall if I have ever seen one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Dynamic languages for you. Not sure if TypeScript would have caught this for me.

@ghost
Copy link

ghost commented Feb 10, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-02-10T21:57:57.944+0000

  • Duration: 37 min 33 sec

Test stats 🧪

Test Results
Failed 0
Passed 240407
Skipped 0
Total 240407

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run module tests for <modules> : Run TAV tests for one or more modules, where <modules> can be either a comma separated list of modules (e.g. memcached,redis) or the string literal ALL to test all modules

  • run benchmark tests : Run the benchmark test only.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@trentm
Copy link
Member Author

trentm commented Feb 10, 2022

run module tests for @elastic/elasticsearch,@elastic/elasticsearch-canary

@trentm trentm requested a review from astorm February 10, 2022 22:36
@trentm trentm marked this pull request as ready for review February 10, 2022 22:36
Copy link
Contributor

@astorm astorm left a comment

Choose a reason for hiding this comment

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

approved

const currSpan = ins.currSpan()
if (currSpan) {
diagResultFromSpan[currSpan] = result
diagResultFromSpan.set(currSpan, result)
Copy link
Contributor

Choose a reason for hiding this comment

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

it got by my review too so sign me up for the :embarrassment: newsletter.

@trentm trentm merged commit 8852764 into main Feb 11, 2022
@trentm trentm deleted the trentm/issue2569-memleak2 branch February 11, 2022 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-nodejs Make available for APM Agents project planning.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak in v3.28.0

4 participants