You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
memory usage will continue creeping up. Using tracemalloc you'll find memory will be attributed to a stack like the following:
File "/Users/amohr/.pyenv/versions/3.6.4/lib/python3.6/site-packages/datadog/api/resources.py", line 370
return APIClient.submit(method, name, body)
File "/Users/amohr/.pyenv/versions/3.6.4/lib/python3.6/site-packages/datadog/api/service_checks.py", line 42
return super(ServiceCheck, cls)._trigger_action('POST', 'check_run', **body)
File "/Users/amohr/Library/Preferences/PyCharm2017.3/scratches/re_leak.py", line 15
response = dd_api.ServiceCheck.check(**{'check': 'CalendarSyncer.execution_state', 'host_name': HOST_NAME, 'status': 0})
File "/Users/amohr/Library/Preferences/PyCharm2017.3/scratches/re_leak.py", line 30
test()
File "/Users/amohr/Library/Preferences/PyCharm2017.3/scratches/re_leak.py", line 36
main()
I traced it to: datadog.api.http_client:RequestClient.request missing a s.close(). It appears if you don't close a requests session it will not go away :(
The text was updated successfully, but these errors were encountered:
btw, this is pretty heavy handed of creating a session for each request given a session creates a pool of connections. It would be nice to know why this seems to leak w/o calling close. The closest conversation I found to this was: psf/requests#1685 . Also perhaps this session was created to make it thread safe? would be worth a comment. Still getting a leak with the above PR too :(
with a script like the following:
memory usage will continue creeping up. Using tracemalloc you'll find memory will be attributed to a stack like the following:
I traced it to: datadog.api.http_client:RequestClient.request missing a
s.close()
. It appears if you don't close a requests session it will not go away :(The text was updated successfully, but these errors were encountered: