Client: client does not close SSL socket after request completes

オープン
#386 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
api, backend

調査の方向性

googlemaps.Client から始めて geocode リクエストのパスを追い、その後、コード例で ResourceWarning を再現します。リクエストのクリーンアップ動作を、参照されている google-api-python-client の issue および pull request と比較します。完了の条件は、リクエストによって未クローズの SSL ソケットが残されなくなることです。

索引モデルが issue の本文から書いたものです。

説明

priority: p3 type: bug
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 https://github.com/googleapis/google-api-python-client/issues/618
If it is indeed the same there was a fix in google-api-python-client here: https://github.com/googleapis/google-api-python-client/pull/1038

主要言語
Python
スター
5k
フォーク
1.4k
平均マージ
5時間 9分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googlemaps/google-maps-services-python のほかの issue

googlemaps/google-maps-services-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。