-
Notifications
You must be signed in to change notification settings - Fork 86
Clear connection map on clean up. (dfs 2834) #9111
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
Conversation
WalkthroughThe changes update the "node-rdkafka" dependency in Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant KafkaNotificator
participant KafkaBroker
Client->>KafkaNotificator: connect()
KafkaNotificator->>KafkaBroker: Initiate connection
KafkaBroker-->>KafkaNotificator: Connection result (success/failure)
KafkaNotificator->>KafkaNotificator: Log connection status
Client->>KafkaNotificator: promise_notify(notification)
KafkaNotificator->>KafkaBroker: Send notification
KafkaBroker-->>KafkaNotificator: Delivery report (success/failure)
KafkaNotificator->>KafkaNotificator: Log send result
Client->>KafkaNotificator: destroy()
KafkaNotificator->>KafkaNotificator: Check if connected
KafkaNotificator-->>KafkaBroker: flush & disconnect (if connected)
KafkaNotificator->>KafkaNotificator: Log destruction status
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! 📜 Recent review detailsConfiguration used: .coderabbit.yaml ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/labeler.yml (1)
1-2
: GitHub labeler configuration looks good but consider more specific rules.The configuration will automatically apply the
Enable-Auto-Rebase
label to all PRs since the regex.*
matches any branch name. This may be intentional for this repository's workflow.Consider if you want more specific labeling rules based on branch patterns:
Enable-Auto-Rebase: - - head-branch: '.*' + - head-branch: '^(feature|bugfix|hotfix)/.*'
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (4)
.github/labeler.yml
(1 hunks).github/workflows/autolabel-prs.yml
(1 hunks)package.json
(1 hunks)src/util/notifications_util.js
(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: build-noobaa-image
- GitHub Check: run-jest-unit-tests
- GitHub Check: run-package-lock-validation
- GitHub Check: Summary
🔇 Additional comments (6)
package.json (1)
110-110
: ```shell
#!/bin/bash
npm view node-rdkafka versions --json
npm view [email protected] version</details> <details> <summary>.github/workflows/autolabel-prs.yml (1)</summary> `1-18`: **GitHub Actions workflow for PR labeling is well-configured.** The workflow uses appropriate triggers, permissions, and actions versions. Using `pull_request_target` is correct for this use case as it allows the workflow to run with write permissions on external PRs. </details> <details> <summary>src/util/notifications_util.js (4)</summary> `109-110`: **LGTM! Connection map cleanup addresses the core issue.** This change correctly implements the PR objective to clear the connection map during cleanup, preventing reuse of stale connections in containerized environments. The order is appropriate - clearing `connect_str_to_connection` before `notif_to_connect`. --- `276-294`: **Enhanced Kafka connection logging improves troubleshooting.** The additional debug logging provides better visibility into the Kafka connection lifecycle, including connection attempts, success/failure events, and error handling. --- `307-315`: **Improved callback signature and notification logging.** The callback signature was simplified by removing the unused `offset` parameter, and additional debug logging helps track notification success/failure with connection details. --- `321-325`: **Connection state check prevents unnecessary operations.** Adding `isConnected()` check before calling `flush()` and `disconnect()` prevents potential errors when the connection is already inactive, improving robustness. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
d61c5fc
to
5f9de81
Compare
5f9de81
to
2cef7cd
Compare
…lso add logs, bump version Signed-off-by: Amit Prinz Setter <[email protected]>
2cef7cd
to
7226ecb
Compare
…lso add logs, bump version (noobaa#9111) Signed-off-by: Amit Prinz Setter <[email protected]>
…lso add logs, bump version (noobaa#9111) Signed-off-by: Amit Prinz Setter <[email protected]>
Describe the Problem
When Notificator is done, it should clean the map containing the connections established during it's run.
Otherwise these stale connection would be used in the next run.
This scenario is relevant only to containerized (ie, does not affect NC).
Also-
-add more logs
-bump version 3.4.0 -> 3.4.1
Explain the Changes
Issues: Fixed #xxx / Gap #xxx
Testing Instructions:
Summary by CodeRabbit
Bug Fixes
Chores
Style