-
Notifications
You must be signed in to change notification settings - Fork 23
BB-727: Fix ZookeeperConfigManager event listener leaks #2687
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
base: development/9.0
Are you sure you want to change the base?
Conversation
Hello bourgoismickael,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Codecov Report❌ Patch coverage is
Additional details and impacted files
@@ Coverage Diff @@
## development/9.0 #2687 +/- ##
================================================
Coverage 74.05% 74.05%
================================================
Files 201 201
Lines 13449 13477 +28
================================================
+ Hits 9959 9980 +21
- Misses 3480 3487 +7
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses event listener leaks in the ZookeeperConfigManager by improving watcher management and separating list/get config operations. The key improvements include early detection of watcher leaks, preventing redundant ZooKeeper remove operations when watchers notify of deleted bucket configs, and enhanced logging for better debugging.
- Added early warning system for ZooKeeper watcher leaks to detect issues before hitting EventEmitter limits
- Separated
getConfigandlistConfigsevent handlers to avoid unnecessary bucket list operations - Modified
removeConfigto optionally skip ZooKeeper emission when triggered by a watcher notification
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/BackbeatConsumer.js | Enhanced logging to safely convert Buffer keys to strings for better debugging |
| extensions/notification/configManager/ZookeeperConfigManager.js | Core fixes for watcher leak detection, separated list/get config handlers, and added conditional ZK emission for removeConfig |
| extensions/notification/NotificationQueuePopulator.js | Corrected typo in comment from "deleter" to "deleted" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
62f6510 to
dc1fe12
Compare
Fix `key: { type: 'Buffer', data: [ 104, 101, 108, 108, 111 ] }`
To `key: 'hello'`
The watcher NODE_DELETED already calls removeConfig with false Because it's already removed from zk if the event is received There is no need to send a request to zk
This kind of error can happen if data is undefined when the read is triggered too late when the znode is already removed
Otherwise we need a few buckets and bucket operations to trigger the event emitter listener limit warning at 10 listeners
The getConfig should not trigger a listing with watcher as it duplicates an already existing watcher. This can have an exponential effect of adding even more watchers when events are triggered. A clear separation prevent this effect: - only NODE_CHILDREN_CHANGED should trigger a new listing to reapply a watcher - getConfig should be contained to a single bucket (discovered by listing, or from watcher NODE_DATA_CHANGED)
694086a to
66d8b1a
Compare
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
|
/create_integration_branches |
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option The following options are set: create_integration_branches |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
The following options are set: create_integration_branches |
7edd397 to
80072f1
Compare
History mismatchMerge commit #7edd3977408e2654642035c90a030202a5b764bc on the integration branch It is likely due to a rebase of the branch Please use the The following options are set: create_integration_branches |
Atomic mkdirp to prevent trigger a watcher for znode creation before data is set on the znode
80072f1 to
3dc379d
Compare
3dc379d to
f4614f2
Compare
|
@bert-e reset |
Reset completeI have successfully deleted this pull request's integration branches. The following options are set: create_integration_branches |
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option The following options are set: create_integration_branches |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
The following options are set: create_integration_branches |
Below a sequence diagram showing in red a few problems fixed here