LimeChain / hashport-validator

Official repository containing the source code of the Hashport validators
Apache License 2.0
23 stars 11 forks source link

Fixed a memory leak in the Retry functionality for EVM clients #909

Closed rokn closed 1 year ago

rokn commented 1 year ago

Detailed description: The retry loop was leaking go routine from the flow which was not finished(either the timeout or the executionFunction because when one finished the other couldn't send a message on it's channel.

The solution is to just use a context with a timeout and leave the handling to the user which works perfectly in our case as everywhere we are using this we are already using a context.

Special notes for your reviewer:

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #909 (9af038f) into main (08b8458) will increase coverage by 0.14%. The diff coverage is 0.00%.

:exclamation: Current head 9af038f differs from pull request most recent head 0d0c186. Consider uploading reports for the commit 0d0c186 to get more accurate results

@@            Coverage Diff             @@
##             main     #909      +/-   ##
==========================================
+ Coverage   64.15%   64.29%   +0.14%     
==========================================
  Files          86       86              
  Lines        6731     6716      -15     
==========================================
  Hits         4318     4318              
+ Misses       2199     2184      -15     
  Partials      214      214              
Flag Coverage Δ
unittests 64.29% <0.00%> (+0.14%) :arrow_up:

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

Files Changed Coverage Δ
app/clients/evm/client.go 56.36% <0.00%> (+4.69%) :arrow_up: