Skip to content

ResourceWarning: unclosed <socket.socket... #1018

Locked Answered by jertel
ctnguyenvn asked this question in Q&A
Discussion options

You must be logged in to vote

If you are opening connections in your enhancement class then yes you are responsible for ensuring they are properly closed. However, I suspect what you're observing is an artifact of Python's garbage collection combined with urllib3's connection pooling.

Another user posted something similar earlier this year: #887

And elastic discussions on this topic also exist: elastic/elasticsearch-py#1533

This AWS issue has some useful background, even though it's specific to boto3, but the premise is similar: boto/boto3#454

Based on the public information like that in the links above, it appears that this warning may not be cause for concern. If you experiencing connection errors or crashing I woul…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jertel
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants