Skip to content

Conversation

@Technoboy-
Copy link
Contributor

@Technoboy- Technoboy- commented Mar 1, 2025

Motivation

When client uses the same connection to subscribe many topics, the mop proxy will create multi connections to the target broker. If some of the channel(proxy to broker) has no msg, the channel will be closed due to inactive event. In this case, the mop proxy could close the only one connection. and cause the client to be in a wrong behavior.

TestProxyConnectMultiBroker could reproduce this issue.

Modifications

Describe the modifications you've done.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@Technoboy- Technoboy- requested a review from mattisonchao as a code owner March 1, 2025 07:51
@github-actions
Copy link

github-actions bot commented Mar 1, 2025

@Technoboy-:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions
Copy link

github-actions bot commented Mar 1, 2025

@Technoboy-:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions
Copy link

github-actions bot commented Mar 1, 2025

@Technoboy-:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@Technoboy- Technoboy- merged commit c440699 into master Mar 3, 2025
41 of 48 checks passed
Technoboy- added a commit that referenced this pull request Mar 3, 2025
Technoboy- added a commit that referenced this pull request Mar 3, 2025
@caihualin
Copy link
Contributor

adapterChannel.registerClosureListener(future -> {
topicBrokers.values().remove(adapterChannel);
if (topicBrokers.values().size() <= 1) {
if (log.isDebugEnabled()) {
log.debug("Adapter channel inactive, close related connection {}", connection);
}
connection.getChannel().close();
} else {
if (log.isDebugEnabled()) {
log.debug("connection {} has more than one AdapterChannel", connection);
}
}
});
It seems that there is a memory leak here.
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants