Broken Pipe is not an error; it's a feature

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
python
领域
cli, networking

调研方向

The failure appears when the meshtastic CLI is run with --tcp against a node, using --get security.public_key and --nodes, and the BrokenPipeError [Errno 32] is printed before the next line reads Connected to Radio. Start by reproducing that loop against a TCP node and tracing where the broken pipe is raised and caught in the Python CLI and TCP interface code. The issue asks for a decision on whether this should be renamed or hidden, and it also leaves the remaining 0.5% of failures unexplained, so there is no clear finish line yet.

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

描述

Programming embedded systems is no easy feat. Getting an MCU to do the right thing is easy. Making sure that it can gracefully recover from every anomoly is the art. When we hang a solar node on a tower, we expect it to recover from cloudy days and heavy traffic. The Meshtastic development team has done a good job supporting a wide variety of devices.

I have been putting my stable of Heltec devices through its paces, working them hard and putting them up wet.

Here's a snippet of what I asked a node to do 2000 times.

for ((i=0; i<loops; i++))
do
  echo " "
  echo "Series $i of $loops"
  meshtastic --tcp $DUTIP --get security.public_key
  meshtastic --tcp $DUTIP --nodes --show-fields user.shortName,user.publicKey,since
done
 
./test.nodes.analysis.sh

That generated 32 MB of terminal output, mostly error messages, dominated by BrokenPipeError: [Errno 32] Broken pipe. It wasn't an error at all. The next line was Connected to Radio. Then my request was fulfilled correctly.

Sure, somethig went wrong, but the system recovered and did what it was asked to do. Broken Pipe isn't an error. It's a condition that occurred 93% of the time in the course of doing what the user asked.

Test series planned:             2000  
Series completed:                2000
Meshtastic commands executed:    4000
All Broken pipes:                3737
Unexpected OS Error, Errno 104:  5
--reset No route:                0
PKI_UNKNOWN_PUBKEY:              0
PKI_SEND_FAIL_PUBLIC_KEY:        0
NO_CHANNEL:                      0
 
security.public_key gotten okay: 1997
nodelist gotten okay:            1996

Ninety-three percent (93.4%) of these two simple meshtastic commands generate [Errno 32]. There is no significant difference between responses to the two commands.

Yes, there are still 0.5% of these two commands failing. That will require some more sleuthing.

In the mean time, since Broken Pipe isn't a showstopper, let's rename it and bury the messages. It is, apparentlty, part of normal operation.

主要语言
Python
星标
855
派生
355
平均合并
3 天 3 小时
30 天内合并 PR
12

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

meshtastic/python 的其他 Issue

查看 meshtastic/python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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