pytest-dev / pytest-dev/execnet

Improve handling of execnet.gateway_bootstrap.HostNotFound

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

还没有人认领这个 Issue。

主要语言
Python
星标
102
派生
47
PR 合并指标
30 天内没有已合并 PR

描述

If a node is down the output is rather verbose:

gw0 Issh_exchange_identification: Connection closed by remote host
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "…/Vcs/execnet/execnet/gateway_bootstrap.py", line 45, in bootstrap_exec
INTERNALERROR>     s = io.read(1)
INTERNALERROR>   File "…/Vcs/execnet/execnet/gateway_base.py", line 389, in read
INTERNALERROR>     "expected %d bytes, got %d" % (numbytes, len(buf)))
INTERNALERROR> EOFError: expected 1 bytes, got 0
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/_pytest/main.py", line 176, in wrap_session
INTERNALERROR>     config.hook.pytest_sessionstart(session=session)
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/pluggy/hooks.py", line 258, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/pluggy/callers.py", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/xdist/dsession.py", line 81, in pytest_sessionstart
INTERNALERROR>     nodes = self.nodemanager.setup_nodes(putevent=self.queue.put)
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/xdist/workermanage.py", line 67, in setup_nodes
INTERNALERROR>     nodes.append(self.setup_node(spec, putevent))
INTERNALERROR>   File "…/project/.venv/lib/python3.6/site-packages/xdist/workermanage.py", line 71, in setup_node
INTERNALERROR>     gw = self.group.makegateway(spec)
INTERNALERROR>   File "…/Vcs/execnet/execnet/multi.py", line 128, in makegateway
INTERNALERROR>     gw = gateway_bootstrap.bootstrap(io, spec)
INTERNALERROR>   File "…/Vcs/execnet/execnet/gateway_bootstrap.py", line 98, in bootstrap
INTERNALERROR>     bootstrap_exec(io, spec)
INTERNALERROR>   File "…/Vcs/execnet/execnet/gateway_bootstrap.py", line 50, in bootstrap_exec
INTERNALERROR>     raise HostNotFound(io.remoteaddress)
INTERNALERROR> execnet.gateway_bootstrap.HostNotFound: xdistnode1

I think this should be caught and turned into a proper error message.

贡献指南

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

从这里开始

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

调研方向

首先阅读 execnet/gateway_bootstrap.py,尤其是 bootstrap_exec 和 bootstrap,并使用报告的 HostNotFound 路径作为入口。使用一个已停止的 node 重现该故障,并确认结果是简洁且恰当的错误消息,而不是冗长的 INTERNALERROR traceback。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
distributed-systems
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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