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: mongodb connection pool patch #3665

Merged
merged 21 commits into from
Oct 17, 2023

Conversation

david-luna
Copy link
Member

@david-luna david-luna commented Oct 13, 2023

This PR patches Mongodb's ConectionPool class to ensure the context is not lost when queueing the commands. The agent makes use of the AsyncLocalStiorage.bind static function to inject the context into the queued callbacks.

The PR also migrates to the new test implementations making use of runTestFixtures util.

Fixes #3161

NOTE: its a replica from #3657 to omit all the conversation that produced the new patch registry in #3658

Checklist

  • Implement code
  • Add tests
  • Update TypeScript typings
  • Update documentation
  • Add CHANGELOG.asciidoc entry
  • Commit message follows commit guidelines

@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Oct 13, 2023
@elastic-apm-tech elastic-apm-tech added this to In Progress in APM-Agents (OLD) Oct 13, 2023
@david-luna david-luna mentioned this pull request Oct 13, 2023
6 tasks
@david-luna david-luna marked this pull request as draft October 13, 2023 00:09
trentm
trentm previously approved these changes Oct 13, 2023
@trentm
Copy link
Member

trentm commented Oct 13, 2023

Ah, I reviewed quickly and hasn't noticed the test failures:

console.log.info(`# SKIP ${isMongodbIncompat}`);

I assume that is an easy fix.

@david-luna
Copy link
Member Author

Ah, I reviewed quickly and hasn't noticed the test failures:

console.log.info(`# SKIP ${isMongodbIncompat}`);

I assume that is an easy fix.

The effects of search & replace if your search term is not accurate enough 😅

@david-luna david-luna marked this pull request as ready for review October 16, 2023 10:53
@david-luna david-luna merged commit 517174f into main Oct 17, 2023
16 checks passed
APM-Agents (OLD) automation moved this from In Progress to Done Oct 17, 2023
@david-luna david-luna deleted the dluna/3161-mongodb-connection-pool-patch branch October 17, 2023 17:00
trentm pushed a commit that referenced this pull request Oct 18, 2023
The recent refactor of mongodb.test.js missed handling the MONGODB_HOST
env var used in Docker tests.

Refs: #3665
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
Development

Successfully merging this pull request may close these issues.

Mongoose spans are getting attached to wrong parent transaction
2 participants