MagicStack / MagicStack/uvloop
Repeating calls to connect_write_pipe with sys.stdout as a stream lead to FileExistsError exception
未关闭
还没有人认领这个 Issue。
help wanted
need more info
- 主要语言
- Cython
- 星标
- 11.9k
- 派生
- 616
- PR 合并指标
- 30 天内没有已合并 PR
描述
- uvloop version: 0.11.3, 0.12.2, 0.13.0rc1
- Python version: 3.6, 3.7
- Platform: linux, macos
- Can you reproduce the bug with
PYTHONASYNCIODEBUGin env?: yes
Hello, this example doesn't work with uvloop.
import asyncio
import sys
import uvloop
uvloop.install()
loop = asyncio.get_event_loop()
async def main():
transport, protocol = await loop.connect_write_pipe(
asyncio.Protocol, sys.stdout
)
print("okay")
transport2, protocol2 = await loop.connect_write_pipe(
asyncio.Protocol, sys.stdout
)
print("okay")
loop.run_until_complete(main())
okay
Traceback (most recent call last):
File "uvl.py", line 20, in <module>
loop.run_until_complete(main())
File "uvloop/loop.pyx", line 1451, in uvloop.loop.Loop.run_until_complete
File "uvl.py", line 16, in main
asyncio.Protocol, sys.stdout
File "uvloop/loop.pyx", line 2703, in connect_write_pipe
File "uvloop/loop.pyx", line 2698, in uvloop.loop.Loop.connect_write_pipe
File "uvloop/handles/pipe.pyx", line 170, in uvloop.loop.WriteUnixTransport._open
File "uvloop/handles/pipe.pyx", line 29, in uvloop.loop.__pipe_open
FileExistsError: [Errno 17] File exists
please, see discussion here https://github.com/B2W-BIT/aiologger/issues/42#issuecomment-457283504
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用 sys.stdout 反复调用 loop.connect_write_pipe 重现该示例,然后检查 uvloop/loop.pyx 和 uvloop/handles/pipe.pyx 中 stack-trace 的入口点。比较第一次和第二次打开管道的路径,并添加回归测试覆盖;完成标准是,在报告的平台上重复调用能够在不出现 FileExistsError 的情况下完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- networking
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 35/100