[Bug] [BanyanDB] timestamp.ParseDuration silently drops everything after "d"
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 83/100
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/skywalking
-
[BanyanDB] Let trace queries exclude the raw span from resultsPossibly taken @hanahmily claimed this today. Openenhancement
apache/skywalking#14288 · 1 assignee ·
Maintainers usually reply within 1 day
-
[BanyanDB] Data race and nil-pointer panic: measure write during standalone shutdown after segment closePossibly taken @hanahmily claimed this today. Openbug
apache/skywalking#14285 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
apache/skywalking#14283 · 1 comment ·
Maintainers usually reply within 1 day
-
[BanyanDB] Store trace binary tags only in core storage, not in secondary index (sidx)Possibly taken @hanahmily claimed this today. Openenhancement
apache/skywalking#14282 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug] BanyanDB stream query on a hot entity scans all its rows despite a small limitPossibly taken @hanahmily claimed this 8 days ago. Openbug
apache/skywalking#14261 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in apache/skywalking
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
testng-team/testng#3672 ·
Maintainers usually reply within 1 day
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-edc/IdentityHub#1296 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
cloudfoundry/uaa#4194 ·
Maintainers usually reply within 1 day
-
area: ui priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
tetsuji16/microProject#1721 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days