Fix memory leak in module greendns (alternative to #682)#811
Fix memory leak in module greendns (alternative to #682)#811itamarst merged 7 commits intoeventlet:masterfrom
Conversation
temoto
left a comment
There was a problem hiding this comment.
@jiajunsu thank you very much for attention to this problem.
I believe if we're going to break compat with external code by changing public variable type, it's better to do it loud. Would not want somebody to have isinstance(err, eventlet.support.greendns.EAI_EAGAIN_ERROR) always False because it's a function now.
Please do either:
_new_eagain_error = lambda ...- or
EAI_EAGAIN_MESSAGE = "Lookup timed out"; raise socket.gaierror(socket.EAI_AGAIN, EAI_EAGAIN_MESSAGE)
Thanks for the comment. I just tried another way to keep Besides, if we call |
|
@temoto I've passed the testcases of |
|
Looks good to merge. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #811 +/- ##
=====================================
- Coverage 53% 53% -1%
=====================================
Files 88 88
Lines 9881 9883 +2
Branches 1852 1852
=====================================
+ Hits 5335 5336 +1
- Misses 4156 4157 +1
Partials 390 390
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Change `EAI_*_ERROR` to `lambda` expression, and initialize them when being called, to avoid memory leak with `__traceback__.tb_next` fixes eventlet#810
Add a function to raise new error of exception instance
|
Codecov is flaky... |
|
This one has a test, so may as well be this one. |
Change
EAI_*_ERRORtolambdaexpression, and initialize themwhen being called, to avoid memory leak with
__traceback__.tb_nextfixes #810