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

Open Beginner friendly
#14,287 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@soujasK is already working on this.

Since Dec 1, 2026.

  • #1509 by @soujasK — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
backend

Research direction

Start by reading pkg/timestamp.ParseDuration, named in the report, and inspect its existing tests. Reproduce the issue with "1d12h" and check that parsing combines the day and remaining duration or returns an error for invalid input. Done means the reported cases behave correctly and tests cover them.

Written by the indexing model from the issue text.

Description

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
Dominant language
Java
Stars
25k
Forks
6.6k
Avg merge
10h 45m
Merged PRs (30d)
49

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/skywalking

All issues in apache/skywalking

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.