Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client: client does not close SSL socket after request completes #386

Open
davidbeers opened this issue Nov 13, 2020 · 1 comment
Open
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@davidbeers
Copy link

Environment details

  1. Occurs with any request using googlemaps.Client
  2. macOS Mojave
  3. Library version: 4.4.2

Steps to reproduce

  1. Instantiate a googlemaps Client
  2. Make a request
  3. Observe warning of unclosed SSL socket in console

Code example

import googlemaps

def get_lat_lng(self, address: str):
    gmaps = googlemaps.Client(key="api_key")
    geocode_result = gmaps.geocode(address)
    return geocode_result

Stack trace

ResourceWarning: unclosed <ssl.SSLSocket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.1.4', 59981), raddr=('172.217.12.10', 443)>

Impact:

Services using the googlemaps client could easily run out of sockets because of this bug.

Potential resolution:

This bug appears to be the same as googleapis/google-api-python-client#618
If it is indeed the same there was a fix in google-api-python-client here: googleapis/google-api-python-client#1038

@davidbeers davidbeers added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Nov 13, 2020
@jpoehnelt jpoehnelt added priority: p2 Moderately-important priority. Fix may not be included in next release. priority: p3 Desirable enhancement or fix. May not be included in next release. and removed triage me I really want to be triaged. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 28, 2021
@luizcartolano2
Copy link

Having the same problem here. Any ideas on how to fix this?

@jpoehnelt jpoehnelt removed their assignment Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants