Decode context.Canceled, context.DeadlineExceeded etc as a reference to the stdlib instance
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- go
调研方向
首先阅读 issue 中提到的 leaf decoder,并跟踪通过网络传输的标准库错误是如何被重建的。检查 context.Canceled 和 context.DeadlineExceeded 的表示方式,然后验证解码返回的是标准库实例,从而使与 == 的比较能够成功。
由索引模型根据 Issue 内容生成。
描述
Currently, instances of the stdlib errors trasnferred over the network are decoded into an object of the same type/value, but not the same instance. So reference comparisons with == with the stdlib instance fail.
This matters for e.g. context.Context.Err() which describes in its API doc that it returns the standrd errors unwrapped so it's legitimate for a caller to use ==.
We could address that by adding a special case in the leaf decoder, so that if a leaf is one of the known stdlib errors, we return the stdlib instance instead.
- 主要语言
- Go
- 星标
- 2.5k
- 派生
- 75
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cockroachdb/errors 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 52/100
cockroachdb/errors#162 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 48/100
cockroachdb/errors#156 · 20 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 30/100
cockroachdb/errors#155 · 1 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
cockroachdb/errors#146 ·
-
难度 4/5 3-5 天 新手友好度 35/100
cockroachdb/errors#145 · 1 条评论 · 1 个 reaction ·
查看 cockroachdb/errors 的全部 Issue
相似的 Issue
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
kind/bug status/0-triage
难度 2/5 1-3 小时 新手友好度 75/100
-
🤔 refinement needed
难度 2/5 1-3 小时 新手友好度 75/100
equinor/radix-operator#1979 ·