MagicStack / MagicStack/uvloop

SSL connection error while debug is enabled

未关闭
#449 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@fantix 已经在做这个了。

开始于 2021年10月27日。

主要语言
Cython
星标
11.9k
派生
616
PR 合并指标
30 天内没有已合并 PR

描述

* **uvloop version**: 0.15.2
* **Python version**: 3.7.3
* **Platform**: Debian GNU/Linux 10
* **Can you reproduce the bug with `PYTHONASYNCIODEBUG` in env?**: yes
* **Does uvloop behave differently from vanilla asyncio? How?**: yes, error in uvloop code

Sometimes when asyncio debug enabled (and connection is closed before starting SSL handshake? ) I got the error:
```
protocol:
transport:
Traceback (most recent call last):
File "uvloop/handles/stream.pyx", line 987, in uvloop.loop.__uv_stream_buffered_on_read
File "uvloop/loop.pyx", line 107, in uvloop.loop.run_in_context1
File "uvloop/sslproto.pyx", line 379, in uvloop.loop.SSLProtocol.buffer_updated
File "uvloop/sslproto.pyx", line 505, in uvloop.loop.SSLProtocol._do_handshake
File "uvloop/sslproto.pyx", line 531, in uvloop.loop.SSLProtocol._on_handshake_complete
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
```

Looks like you should check if handshake is started before getting _handshake_start_time sslproto.pyx:
```
if self._loop.get_debug():
dt = self._loop.time() - self._handshake_start_time
aio_logger.debug("%r: SSL handshake took %.1f ms", self, dt * 1e3)
```

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。