Functions like get_data are inherently not thread safe
还没有人认领这个 Issue。
评估
调研方向
Start by reading the implementations of get_data and save, then examine how shelve is used during concurrent operations. Define and test the proposed option to disable automatic disk saving and provide a manual save step; done means concurrent use avoids unprotected persistence and the final state can be saved consistently.
由索引模型根据 Issue 内容生成。
描述
The current implementation of get_data directly calls save, which introduces a risk when used in multithreaded contexts. The disk I/O performed by save is not protected, but locking around it has serious performance implications.
In my own private implementation of a REST API client for PokeAPI in python (sorry just found out about this project), I solved this by separating in‑memory caching from disk persistence. My approach was:
- Keep an in‑memory cache updated freely across threads.
- Disable automatic disk saving during concurrent operations.
- Manually invoke a disk save step once threads have finished, ensuring serialization and consistency.
One note is it would likely involve not using shelve as I believe that is not thread safe. But other features may be more suited.
With approval, I am willing to begin migrating my code to use pokebase, implement and test a option to disable auto‑save and give manual control.
- 主要语言
- Python
- 星标
- 361
- 派生
- 58
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PokeAPI/pokebase 的其他 Issue
-
Status update未关闭
难度 5/5 一周以上 新手友好度 20/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
correction metadata
难度 2/5 1-3 小时 新手友好度 68/100
acl-org/acl-anthology#10104 · 1 条评论 ·
维护者通常 1 天内回复
-
bug status/needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
prowler-cloud/prowler#12885 · 1 条评论 ·
维护者通常 1 天内回复
-
Bug in GaussianTailProbabilityCalibrator: running_statistics=False still uses a windowed variance未关闭bug good first issue
难度 2/5 1-3 小时 新手友好度 88/100
selimfirat/pysad#107 ·
维护者通常 1 天内回复
-
bug ci-failure high priority
难度 1/5 1 小时以内 新手友好度 88/100
vllm-project/vllm-omni#8194 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复