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

Fix memory leak of the callChoreo access token request helper function #200

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sadilchamishka
Copy link
Contributor

Purpose

There is possible memory leak due to not closing the http connection after the required response is received.

In httpClient version 5.x the automatic resource deallocation happens but in httpClient version 4.x the deallocation has to be done.
ex: EntityUtils.consume(entityOne);
Ref:- https://www.baeldung.com/apache-httpclient-vs-closeablehttpclient#1-automatic-resource-deallocation-httpclient-4x

httpClient.execute(httpGetOne, responseOne -> {
          HttpEntity entityOne = responseOne.getEntity();
          EntityUtils.consume(entityOne);
          assertThat(responseOne.getCode()).isEqualTo(HttpStatus.SC_OK);
          return responseOne;
      });

@sadilchamishka sadilchamishka marked this pull request as draft January 5, 2025 03:51
Copy link

codecov bot commented Jan 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.76%. Comparing base (17b92fc) to head (df73476).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #200   +/-   ##
=========================================
  Coverage     39.75%   39.76%           
  Complexity      408      408           
=========================================
  Files           111      111           
  Lines          3675     3677    +2     
  Branches        416      416           
=========================================
+ Hits           1461     1462    +1     
- Misses         2058     2059    +1     
  Partials        156      156           
Flag Coverage Δ
unit 43.14% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant