Skip to content

Fix connection leakage in CustomRestClient#1472

Merged
huizhilu merged 1 commit intoapache:masterfrom
huizhilu:custom-rest
Oct 16, 2020
Merged

Fix connection leakage in CustomRestClient#1472
huizhilu merged 1 commit intoapache:masterfrom
huizhilu:custom-rest

Conversation

@huizhilu
Copy link
Contributor

@huizhilu huizhilu commented Oct 16, 2020

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

Fixes #1471

Description

  • Here are some details about my PR, including screenshots of any UI changes:

There is connection leakage in CustomRestClientImpl and causes timeout waiting for connection.

Fix this issue by consuming entity and releasing stream and connection.

Tests

  • The following tests are written for this issue:

Manually reproduce the issue locally. After the fix, the issue is gone.

  • The following is the result of the "mvn test" command on the appropriate module:
[INFO] Tests run: 170, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 100.208 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 170, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:46 min
[INFO] Finished at: 2020-10-16T15:20:24-07:00
[INFO] ------------------------------------------------------------------------

Documentation (Optional)

  • In case of new functionality, my PR adds documentation in the following wiki page:

(Link the GitHub wiki you added)

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

@huizhilu huizhilu self-assigned this Oct 16, 2020
@huizhilu huizhilu force-pushed the custom-rest branch 3 times, most recently from 26c9ce7 to c814d3a Compare October 16, 2020 20:49
@kaisun2000
Copy link
Contributor

@pkuwm, yes, this should fix the issue I found which can be urgent. So without a unit test, it is fine for now.

Can you also add an issue to add a unit test?

@huizhilu
Copy link
Contributor Author

@pkuwm, yes, this should fix the issue I found which can be urgent. So without a unit test, it is fine for now.

Can you also add an issue to add a unit test?

I actually thought about unit testing the connection leak and did an investigation on it. It is not easy. As long as we use it correctly, it is fine.
One way is, once we switch to use an instrumented http client, we can check the metrics in the unit test to test the connection leak.
Created a ticket: #1475 for tracking.

@huizhilu
Copy link
Contributor Author

This PR is ready to be merged, approved by @kaisun2000

There is connection leakage in CustomRestClientImpl and causes timeout waiting for connection.
Fix this issue by consuming entity and releasing the content stream and connection.

@huizhilu huizhilu merged commit c3515f4 into apache:master Oct 16, 2020
@huizhilu huizhilu deleted the custom-rest branch October 16, 2020 22:35
alirezazamani pushed a commit to alirezazamani/helix that referenced this pull request Oct 22, 2020
There is connection leakage in CustomRestClientImpl and causes timeout waiting for connection.
Fix this issue by consuming entity and releasing the content stream and connection.
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.

Connection leakage in CustomRestClient

2 participants