Add URL to Logs when Retrying

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
api, backend

調査の方向性

zyte_api/aio/client.pyから始め、特に62–130行目のretry関連コードを確認し、DEBUG retryメッセージがどのように組み立てられているかを調べてください。リクエストURLが含まれるようにログを更新し、その後、retryメッセージにURLが含まれ、既存のエラー詳細が維持されていることを確認してください。

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

説明

enhancement

Currently, this section of the code https://github.com/zytedata/python-zyte-api/blob/main/zyte_api/aio/client.py#L62-L130 produces this DEBUG log when retrying errors:

[zyte_api.aio.retry] Retrying zyte_api.aio.client.AsyncClient.request_raw.<locals>.request in 7.430951650096189 seconds as it raised RequestError: RequestError: 520, message=, headers=<CIMultiDictProxy('Date': 'Tue, 19 Dec 2023 09:07:00 GMT', 'Content-Type': 'application/problem+json', 'Content-Length': '301', 'Connection': 'keep-alive', 'Retry-After': '60', 'Request-Id': '8dc64f033de37f442807c9d378c5044b', 'Vary': 'Accept-Encoding', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Expose-Headers': '*, X-Project-Key', 'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, PATCH, OPTIONS', 'Access-Control-Allow-Headers': 'DNT, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Range, Authorization, X-Project-Key', 'Access-Control-Max-Age': '1728000')>, body=b'{"type":"/download/temporary-error","title":"Temporary Downloading Error","status":520,"detail":"There is a downloading problem which might be temporary. Retry in N seconds from \'Retry-After\' header or open a support ticket from https://support.zyte.com/support/tickets/new if it fails consistently."}', request_id=8dc64f033de37f442807c9d378c5044b.

Notice that the URL of the request in isn't logged here, but the header is.

主要言語
Python
スター
30
フォーク
9
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

zytedata/python-zyte-api のほかの issue

zytedata/python-zyte-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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