Auto-isolate asyncio tasks if event loop is running
还没有人认领这个 Issue。
评估
调研方向
先阅读现有的 AsyncioIntegration 及其隔离作用域行为,然后比较提议的自动启用设计。检查如何对正在运行的事件循环进行修补、是否可以重复修补,以及这会如何影响现有的 AsyncioIntegration 用户。完成的标准是任务隔离能够自动工作,同时附加功能仍需显式 opt-in,并且在没有事件循环的情况下能够优雅地失败。
由索引模型根据 Issue 内容生成。
描述
Currently, the opt-in AsyncioIntegration is responsible for multiple things, one of them being providing proper scope isolation in asyncio tasks. Without this functionality, people are running into different types of hard-to-diagnose scope bleed issues, like here.
Goal
- Automatically patch the current event loop to isolate tasks in their isolation scopes, if there is an event loop running
- For additional functionality (creating task spans, etc.), explicit opt-in should still be required from users
How to do this
Different ways to do this, each with its own caveats (e.g. introducing breaking changes).
- Take the isolation scope logic out of
AsyncioIntegrationinto its own integration and make it auto-enabled (best effort, if there is no event loop we can't do anything). - Make
AsyncioIntegrationauto-enabled, and change the additional functions it's providing (like task spans) to be opt-in. Also, make it fail gracefully if there is no event loop to patch. - ???
When picking an option, consider:
- Will this break behavior for existing users using the
AsyncioIntegration? - Is there a risk of double-patching the event loop?
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 672
- 平均合并
- 22 小时 47 分钟
- 30 天内合并 PR
- 224
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/sentry-python 的其他 Issue
-
Python
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/sentry-python#7569 · 1 条评论 ·
-
Python
难度 1/5 1 小时以内 新手友好度 85/100
getsentry/sentry-python#7568 · 2 条评论 ·
-
Python
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/sentry-python#7567 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-python#7543 · 2 条评论 · 已指派 1 人 ·
-
Python
难度 2/5 1-3 小时 新手友好度 68/100
getsentry/sentry-python#6992 · 1 条评论 ·
查看 getsentry/sentry-python 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·