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

feat(pulsar): ensure allocated resources are removed on failures (v5.0) #10778

Merged
merged 1 commit into from
May 24, 2023

Conversation

thalesmg
Copy link
Contributor

@thalesmg thalesmg commented May 22, 2023

Fixes https://emqx.atlassian.net/browse/EMQX-9937

Summary

🤖 Generated by Copilot at 44b87f0

This pull request adds a new feature to the emqx_bridge_pulsar module that uses the emqx_resource API to allocate and free resources for each bridge instance. This improves the reliability and robustness of the Pulsar connector. It also adds test cases and modifies some ETS table operations to support this feature.

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Changed lines covered in coverage report
  • Change log has been added to changes/{ce,ee}/(feat|perf|fix)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • [na] If there should be document changes, a PR to emqx-docs.git is sent, or a jira ticket is created to follow up
  • [na] Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • [na] If changed package build workflow, pass this action (manual trigger)
  • [na] Change log has been added to changes/ dir for user-facing artifacts update

@thalesmg thalesmg force-pushed the refactor-pulsar-on-stop-v50 branch from 44b87f0 to 188e9b6 Compare May 22, 2023 20:03
@thalesmg thalesmg requested a review from HJianBo May 22, 2023 20:03
paulozulato
paulozulato previously approved these changes May 22, 2023
apps/emqx_resource/src/emqx_resource.erl Outdated Show resolved Hide resolved
apps/emqx_resource/src/emqx_resource.erl Outdated Show resolved Hide resolved
HJianBo
HJianBo previously approved these changes May 23, 2023
Copy link
Member

@HJianBo HJianBo left a comment

Choose a reason for hiding this comment

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

LGTM

@thalesmg thalesmg dismissed stale reviews from HJianBo and paulozulato via fec3c27 May 23, 2023 12:13
@thalesmg thalesmg force-pushed the refactor-pulsar-on-stop-v50 branch 2 times, most recently from fec3c27 to 8ad360d Compare May 23, 2023 12:14
paulozulato
paulozulato previously approved these changes May 23, 2023
@thalesmg thalesmg force-pushed the refactor-pulsar-on-stop-v50 branch 8 times, most recently from 37ae1dd to 45055e9 Compare May 24, 2023 13:56
@thalesmg thalesmg force-pushed the refactor-pulsar-on-stop-v50 branch from 45055e9 to fd2940c Compare May 24, 2023 15:29
@thalesmg thalesmg marked this pull request as ready for review May 24, 2023 17:19
@thalesmg thalesmg requested a review from a team as a code owner May 24, 2023 17:19
@thalesmg thalesmg requested review from HJianBo May 24, 2023 17:40
@@ -0,0 +1 @@
Refactored Pulsar Producer bridge to avoid leaking resources during crashes.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Refactored Pulsar Producer bridge to avoid leaking resources during crashes.
Refactored Pulsar Producer bridge to avoid leaking resources during crashes at creation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll correct this in the next PR refactoring on_stop, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in #10813

@thalesmg thalesmg merged commit 37061b4 into emqx:master May 24, 2023
103 checks passed
@thalesmg thalesmg deleted the refactor-pulsar-on-stop-v50 branch May 24, 2023 19:00
@yanzhiemq
Copy link
Collaborator

yanzhiemq commented Jun 13, 2023

Enhancements

  • Refactored Pulsar Producer bridge to avoid leaking resources during crashes at creation.

@yanzhiemq
Copy link
Collaborator

yanzhiemq commented Jun 13, 2023

增强

  • 重构 Pulsar 生产者桥接,避免在创建过程中出现崩溃时资源泄漏。

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.

None yet

5 participants