[Bug] [BanyanDB] timestamp.ParseDuration silently drops everything after "d"

オープン 初心者向け
#14,287 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@soujasK がすでに取り組んでいます。

2026年12月1日 から。

  • #1509 @soujasK による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
83/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
backend

調査の方向性

まず、レポートに記載されている 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分
マージ済み PR(30日)
49

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/skywalking のほかの issue

apache/skywalking の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。