ResourceWarning: unclosed <ssl.SSLSocket fd=324, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM
See original GitHub issue- Package Name/Version:
azure-core 1.23.1
azure-cosmos 4.2.0
- Operating System:
Win 10 Pro
- Python Version:
3.10.3
Describe the bug Getting SSL error from demo/example code, pointing to ssl.py:
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=424, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('xxxx', 29156), raddr=('yyyy', 443)>
Object allocated at (most recent call last):
File "C:\python310\lib\ssl.py", lineno 1033
self = cls.__new__(cls, **kwargs)
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=412, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('xxxx', 29157), raddr=('yyyy', 443)>
Object allocated at (most recent call last):
File "C:\python310\lib\ssl.py", lineno 1033
self = cls.__new__(cls, **kwargs)
To Reproduce
client = CosmosClient(url, credential=key)
database = client.get_database_client(database_name)
container = database.get_container_client(container_name)
Expected behavior No SSL close connection error.
Screenshots N/A
Additional context N/A
Issue Analytics
- State:
- Created a year ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
ResourceWarning unclosed socket in Python 3 Unit Test
I'm modifying some code to be compatible between Python 2 and Python 3 , but have observed a warning in unit test output....
Read more >sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=4 ...
Description of problem: See Resource warning on various openstack commands: A couple seen on: - openstack overcloud node introspect --all-manageable ...
Read more >[PYTHON-2338] _RttMonitor causes ResourceWarning
Noticed this ResourceWarning for an unclosed socket while running the tests. The ResourceWarning seem to randomly occur throughout the test ...
Read more >ResourceWarning: unclosed <socket.socket [closed] fd=3 ...
socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('0.0.0.0', 0)> or there is no warning at all due ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@eabase That might be worthwhile - however, I see in the issue you created that you didn’t add any information about the VPN you use and I believe that would be the most useful information for them to have as well. Please ensure you provide as much information as possible so whatever investigation or answer you’re looking for is easier to find for the responsible team.
If there’s any other questions you have with the Cosmos SDK itself, do feel free to ask them. Thank you for using our SDK, and hope your day is going well! 😃
@eabase Yep, I have tried all things that I could think of in terms of setting up and replicating the environment you’re using (Windows machine, Python 3.10.3, same package versions) but have been unable to run into this issue.
It would make sense, as you say, that the VPN is giving some sort of warning with the SSL library since that directly affects the connections made - I’d recommend you try using your current VPN setup along with other SDKs to see if the same behavior happens, since as far as I have seen this does not seem to be a Cosmos SDK issue.