[Bug] [BanyanDB] timestamp.ParseDuration silently drops everything after "d"
维护者通常 1 天内回复
评估
调研方向
首先阅读报告中提到的 pkg/timestamp.ParseDuration,并检查现有测试。使用 "1d12h" 重现问题,并检查解析是否会将天数与剩余时长合并,或者在输入无效时返回错误。报告中的情况均能正确处理且有测试覆盖,即为完成。
由索引模型根据 Issue 内容生成。
描述
Search before asking
- I had searched in the issues and found no similar issues.
Apache SkyWalking Component
BanyanDB (apache/skywalking-banyandb)
What happened
pkg/timestamp.ParseDuration only reads the number before the first "d" and ignores the rest.
"1d12h"-> 24h, no error"2d30m"-> 48h, no error"1day"-> 24h, no error"1.5d"-> error
It's used for measure intervals and BydbQL TIME_BUCKET('...') widths, so TIME_BUCKET('1d12h') groups into 24h buckets without any error.
What you expected to happen
"1d12h" should be 36h, or at least return an error instead of a wrong value.
How to reproduce
d, err := timestamp.ParseDuration("1d12h")
fmt.Println(d, err) // 24h0m0s <nil>
Anything else
Fix could be: parse the day part, then pass the rest to time.ParseDuration and add them. Happy to send a PR with tests.
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要语言
- Java
- 星标
- 25k
- 派生
- 6.6k
- 平均合并
- 10 小时 45 分钟
- 30 天内合并 PR
- 49
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/skywalking 的其他 Issue
-
[BanyanDB] Let trace queries exclude the raw span from results可能已有人在做 @hanahmily 今天认领。 未关闭enhancement
apache/skywalking#14288 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[BanyanDB] Data race and nil-pointer panic: measure write during standalone shutdown after segment close可能已有人在做 @hanahmily 今天认领。 未关闭bug
apache/skywalking#14285 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
apache/skywalking#14283 · 1 条评论 ·
维护者通常 1 天内回复
-
[BanyanDB] Store trace binary tags only in core storage, not in secondary index (sidx)可能已有人在做 @hanahmily 今天认领。 未关闭enhancement
apache/skywalking#14282 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Bug] BanyanDB stream query on a hot entity scans all its rows despite a small limit可能已有人在做 @hanahmily 于 8 天前认领。 未关闭bug
apache/skywalking#14261 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 apache/skywalking 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
testng-team/testng#3672 ·
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 78/100
eclipse-edc/IdentityHub#1296 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
cloudfoundry/uaa#4194 ·
维护者通常 1 天内回复
-
area: ui priority: medium
难度 2/5 1-3 小时 新手友好度 83/100
tetsuji16/microProject#1721 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复