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: Always release HttpContent #21

Merged

Conversation

oriolbellet
Copy link
Contributor

@oriolbellet oriolbellet commented Mar 18, 2021

Potential leak found in HttpClientResponseHandler class. httpContent.release is not called if a Runtime exception is thrown before releasing the object.

Moved HttpContent.release call to a finally block based on following netty documentation ("Inbound messages" section): https://netty.io/wiki/reference-counted-objects.html

A couple of Integration tests were failing in master branch when run locally

* Moved HttpContent.release call to finally block in order to release the object when exception thrown
@codecov
Copy link

codecov bot commented Mar 18, 2021

Codecov Report

Merging #21 (83782a5) into master (f827887) will not change coverage.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #21   +/-   ##
=========================================
  Coverage     79.94%   79.94%           
  Complexity      964      964           
=========================================
  Files           118      118           
  Lines          3460     3460           
  Branches        315      315           
=========================================
  Hits           2766     2766           
  Misses          523      523           
  Partials        171      171           
Impacted Files Coverage Δ Complexity Δ
...http/netty/response/HttpClientResponseHandler.java 81.25% <84.61%> (ø) 27.00 <0.00> (ø)
...ng/platform/net/http/WebSocketListenerAdapter.java 66.66% <0.00%> (-16.67%) 4.00% <0.00%> (-1.00%)
...form/net/http/WebSocketMessageListenerAdapter.java 50.00% <0.00%> (+12.50%) 4.00% <0.00%> (+1.00%)

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 f827887...83782a5. Read the comment docs.

@magnus-gustafsson magnus-gustafsson merged commit ddab186 into king:master Mar 18, 2021
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.

2 participants