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

[dubbo 4890]Undeleted invokers(destroyed) In AbstractProxyProtocol may cause memory leak #4738

Merged
merged 1 commit into from
Apr 11, 2021

Conversation

finalcola
Copy link
Contributor

What is the purpose of the change

destroyed invokers in AbstractProxyProtocol can't be removed from list.

protected <T> Invoker<T> protocolBindingRefer(final Class<T> type, final URL url) throws RpcException {
        final Invoker<T> target = proxyFactory.getInvoker(doRefer(type, url), type, url);
        Invoker<T> invoker = new AbstractInvoker<T>(type, url) {
            @Override
            protected Result doInvoke(Invocation invocation) throws Throwable {
                // ..do something
            }

            // remove this destroyed invoker
            @Override
            public void destroy() {
                super.destroy();
                target.destroy();
                invokers.remove(this);
            }
        };
        invokers.add(invoker);
        return invoker;
    }

Brief changelog

XXXXX

Verifying this change

XXXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-io
Copy link

Codecov Report

Merging #4738 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4738      +/-   ##
============================================
- Coverage     63.97%   63.94%   -0.03%     
  Complexity      451      451              
============================================
  Files           769      769              
  Lines         33178    33182       +4     
  Branches       5229     5229              
============================================
- Hits          21225    21219       -6     
- Misses         9531     9538       +7     
- Partials       2422     2425       +3
Impacted Files Coverage Δ Complexity Δ
...ache/dubbo/rpc/protocol/AbstractProxyProtocol.java 80% <100%> (+1.42%) 0 <0> (ø) ⬇️
...ng/transport/dispatcher/all/AllChannelHandler.java 51.42% <0%> (-5.72%) 0% <0%> (ø)
.../org/apache/dubbo/remoting/ExecutionException.java 15.78% <0%> (-5.27%) 0% <0%> (ø)
.../dubbo/remoting/transport/netty4/NettyChannel.java 61.17% <0%> (-4.71%) 0% <0%> (ø)
.../apache/dubbo/remoting/transport/AbstractPeer.java 63.04% <0%> (-4.35%) 0% <0%> (ø)
...he/dubbo/remoting/transport/netty/NettyServer.java 69.64% <0%> (-3.58%) 8% <0%> (-1%)
...c/main/java/org/apache/dubbo/rpc/RpcException.java 80% <0%> (-3.34%) 0% <0%> (ø)
...org/apache/dubbo/rpc/protocol/AbstractInvoker.java 60.65% <0%> (-3.28%) 0% <0%> (ø)
...pache/dubbo/registry/support/AbstractRegistry.java 78.54% <0%> (-3.07%) 0% <0%> (ø)
...exchange/support/header/HeaderExchangeHandler.java 64.75% <0%> (-2.46%) 0% <0%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c92916...3fcce45. Read the comment docs.

@finalcola finalcola changed the title clear destroyed invokers in AbstractProxyProtocol Undeleted invokers(destroyed) In AbstractProxyProtocol may cause memory leak Aug 12, 2019
@finalcola finalcola changed the title Undeleted invokers(destroyed) In AbstractProxyProtocol may cause memory leak [dubbo 4890]Undeleted invokers(destroyed) In AbstractProxyProtocol may cause memory leak Aug 20, 2019
@finalcola
Copy link
Contributor Author

finalcola commented Aug 21, 2019 via email

@CLAassistant
Copy link

CLAassistant commented Sep 6, 2019

CLA assistant check
All committers have signed the CLA.

@AlbumenJ AlbumenJ merged commit 9338e90 into apache:master Apr 11, 2021
AlbumenJ added a commit to AlbumenJ/dubbo that referenced this pull request May 28, 2021
vio-lin pushed a commit to vio-lin/incubator-dubbo that referenced this pull request Nov 22, 2023
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

4 participants