Skip to content

Conversation

@Mishra-coder
Copy link

@Mishra-coder Mishra-coder commented Nov 25, 2025

Fix #15785
Addresses memory leak caused by excessive MongoDB connection logs when connecting without authentication.

Adds mongodbLogComponentSeverities configuration to suppress client-side connection pool logs.

Changes

  • Added mongodbLogComponentSeverities option in lib/drivers/node-mongodb-native/connection.js
  • Sets connection component logging to 'off' by default
  • Uses hasUserDefinedProperty check to respect user overrides

Technical Details

  • Based on MongoDB Node.js Driver v7.0+ logging configuration
  • Suppresses connection pool event logs
  • Maintains backward compatibility
  • Does not affect custom logging configurations

Note

This addresses client-side logging. If server-side MongoDB logs continue to accumulate, server logging configuration may need adjustment.

Testing

  • Verified against MongoDB Driver documentation
  • Maintains backward compatibility
  • Respects user-defined logging options

Fixes Automattic#15785

Added mongodbLogComponentSeverities configuration to suppress
connection pool logs that were causing memory leaks when connecting
without authentication. Sets connection severity to 'off' by default
while respecting user overrides.
@Mishra-coder
Copy link
Author

Mishra-coder commented Nov 25, 2025

@vkarpov15 PR is ready for merge please review and suggest changes if required..

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

Successfully merging this pull request may close these issues.

Memory leak due to connection not authenticating, exhausting connection pool

1 participant