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

doRefer in RestProtocol may cause OOM #4458

Closed
2 tasks
HzjNeverStop opened this issue Jul 3, 2019 · 4 comments
Closed
2 tasks

doRefer in RestProtocol may cause OOM #4458

HzjNeverStop opened this issue Jul 3, 2019 · 4 comments

Comments

@HzjNeverStop
Copy link
Contributor

HzjNeverStop commented Jul 3, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.3-SNAPSHOT
  • Operating System version: mac os 10.13.6
  • Java version: 1.8.0_171

Steps to reproduce this issue

  1. run the code in unit test:
   @Test
    public void testRestProtocol() {
        protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getExtension("rest");
        URL url = URL.valueOf("rest://127.0.0.1:5342/rest/say?version=1.0.0&interface=org.apache.dubbo.rpc.protocol.rest.DemoService");
        while (true) {
            Invoker<DemoService> invoker = protocol.refer(DemoService.class, url);
            invoker.destroy();
        }
    }

Pls. provide [GitHub address] to reproduce this issue.

Actual Result

What actually happens?
the size of LinkedList [clients] will keep growing, the ResteasyClient hold by it will not release, which will cause OOM easily.

 ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build();
clients.add(client);

the clients in the linkedList will not release when invoker destroyed, they will only be released when the rest protocol destroyed.
I think the protocol layer should not hold the object's such like client, it should be hold by the invoker and has the same lifecycle with invoker

@kaojunsong
Copy link

@chickenlj hello,we have met the same issues.Is this a bug of dubbo,and how to fixed it?

@beiwei30
Copy link
Member

I believe this issue has been addressed by #4614. @kaojunsong @HzjNeverStop would you mind to verify?

@cvictory
Copy link
Contributor

cvictory commented Sep 4, 2019

@HzjNeverStop should you check this issue now ?
If you don't reply , i will close this issue firstly.

@HzjNeverStop
Copy link
Contributor Author

@HzjNeverStop should you check this issue now ?
If you don't reply , i will close this issue firstly.

it's ok, please close this issue, thanks

@cvictory cvictory closed this as completed Sep 9, 2019
@cvictory cvictory removed this from the 2.7.4 milestone Sep 9, 2019
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

No branches or pull requests

4 participants