Add retry logic to Job Tag Update function
评估
调研方向
从 jobs.py 中的 update_tags 函数开始,跟踪 ServerError 如何在客户端请求路径中被抛出。检查现有的请求和异常处理,然后添加所请求的重试行为,并验证大规模标签更新不再因报告的服务器错误而立即失败。
由索引模型根据 Issue 内容生成。
描述
Description
An Internal Server Error pops up whenever a large number of tag updates run parallel or sequentially.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/project-1.0-py3.10.egg/XX/utils/workflow/__init__.py", line 930, in run
start_stage, active_stage, ran_stages = self.setup_continuation(
File "/usr/local/lib/python3.10/site-packages/project-1.0-py3.10.egg/XX/utils/workflow/__init__.py", line 667, in setup_continuation
self._discard_jobs(start_stage, ran_stages)
File "/usr/local/lib/python3.10/site-packages/project-1.0-py3.10.egg/XX/utils/workflow/__init__.py", line 705, in _discard_jobs
self.get_job(jobinfo["key"]).update_tags(
File "/usr/local/lib/python3.10/site-packages/scrapinghub/client/[jobs.py](http://jobs.py/)", line 503, in update_tags
self._client._connection._post('jobs_update', 'json', params)
File "/usr/local/lib/python3.10/site-packages/scrapinghub/[legacy.py](http://legacy.py/)", line 120, in _post
return self._request(url, params, headers, format, raw, files)
File "/usr/local/lib/python3.10/site-packages/scrapinghub/client/[exceptions.py](http://exceptions.py/)", line 98, in wrapped
raise ServerError(http_error=exc)
scrapinghub.client.exceptions.ServerError: Internal server error
This is not a problem if you are doing updates for a couple of jobs, but if you want to mass update this error will pop up eventually.
Adding adaptable retry logic to the update_tags function through that ServerError exception would make it easier to debug and implement large-scale workflows.
- 主要语言
- Python
- 星标
- 204
- 派生
- 62
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
scrapinghub/python-scrapinghub 的其他 Issue
-
Incorrect information for Samples in Job documentation可能已有人在做 @AdrianAtZyte 于 66 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 72/100
-
Zyte Job API: Provision to support Cron Expression or Time Interval可能已有人在做 @AdrianAtZyte 于 67 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 25/100
-
Add async support可能重新可做 @VMRuiz 于 1414 天前认领,目前没有进行中的 PR。 未关闭
scrapinghub/python-scrapinghub#169 · 8 条评论 · 2 个 reaction · 已指派 4 人 ·
-
KeyError: 'status' when trying to schedule spider可能已有人在做 @AdrianAtZyte 于 64 天前认领。 未关闭enhancement
难度 3/5 1-2 天 新手友好度 30/100
scrapinghub/python-scrapinghub#156 · 6 条评论 ·
-
collections.get_store is not working as documented可能已有人在做 @AdrianAtZyte 于 64 天前认领。 未关闭bug docs
难度 3/5 1-2 天 新手友好度 45/100
查看 scrapinghub/python-scrapinghub 的全部 Issue
相似的 Issue
-
bug: conversation context selects the oldest thread messages instead of recent replies可能已有人在做 @BLVCK-MAMBA-6 今天认领。 未关闭bug enhancement
难度 2/5 1-3 小时 新手友好度 84/100
AOSSIE-Org/SkillBot#74 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
bad-antics/lateralus-lang#1438 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
area: control app
难度 2/5 1-3 小时 新手友好度 76/100
glossyio/traffic-monitor#415 ·
维护者通常 1 天内回复
-
apply_matrix_rect takes 6-9% of extract_text time可能已有人在做 @g4lb 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
pdfminer/pdfminer.six#1333 ·
维护者通常 1 天内回复