You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "hr342425 (via GitHub)" <gi...@apache.org> on 2026/01/12 09:31:05 UTC

[PR] fix(banyandb): prevent time range overflow in profile thread snapshot query [skywalking]

hr342425 opened a new pull request, #13660:
URL: https://github.com/apache/skywalking/pull/13660

   ### Fix BanyanDB INVALID_ARGUMENT error when analyzing profile snapshots
   
   - [ ] Add a unit test to verify that the fix works.
   - [x] Explain briefly why the bug exists and how to fix it.
   
   **Bug Description:**
   
   When using BanyanDB as the storage backend and analyzing profile data via the UI, the system throws an `INVALID_ARGUMENT` error:
   
   ```
   org.apache.skywalking.banyandb.v1.client.grpc.exception.InvalidArgumentException: 
   io.grpc.StatusRuntimeException: INVALID_ARGUMENT: begin:{} end:{seconds:9223372036854775 nanos:807000000} 
   is invalid: time is out of range -9223372036854775808 - 9223372036854775807
   ```
   
   **Root Cause:**
   
   In `ProfileAnalyzer.analyze()`, the Go profile fallback logic passes `Long.MAX_VALUE` as the end time to `queryMinSequence()` and `queryMaxSequence()`:
   
   ```java
   int minSeq = getProfileThreadSnapshotQueryDAO().queryMinSequence(segId, 0L, Long.MAX_VALUE);
   int maxSeqExclusive = getProfileThreadSnapshotQueryDAO().queryMaxSequence(segId, 0L, Long.MAX_VALUE) + 1;
   ```
   
   While this works fine for JDBC storage backends, `BanyanDBProfileThreadSnapshotQueryDAO` passes this value directly to `TimestampRange`, which BanyanDB server cannot handle as it exceeds the supported time range.
   
   **Fix:**
   
   Clamp the `start` and `end` time parameters in `BanyanDBProfileThreadSnapshotQueryDAO.querySequenceWithAgg()` to safe bounds using `LOWER_BOUND_TIME` and `UPPER_BOUND_TIME` constants already defined in `AbstractBanyanDBDAO`.
   
   ```java
   long safeStart = Math.max(start, LOWER_BOUND_TIME);
   long safeEnd = Math.min(end, UPPER_BOUND_TIME);
   ```
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
   - [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(banyandb): prevent time range overflow in profile thread snapshot query [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #13660:
URL: https://github.com/apache/skywalking/pull/13660#issuecomment-3741073419

   @hr342425 Could you update the changes.md by following PR template?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(banyandb): prevent time range overflow in profile thread snapshot query [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #13660:
URL: https://github.com/apache/skywalking/pull/13660#issuecomment-3741723524

   > Done. I've updated the changes.md. @wu-sheng
   
   We are working on CI pipeline fixing. The failing ones should not be caused by your changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(banyandb): prevent time range overflow in profile thread snapshot query [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #13660:
URL: https://github.com/apache/skywalking/pull/13660


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(banyandb): prevent time range overflow in profile thread snapshot query [skywalking]

Posted by "hr342425 (via GitHub)" <gi...@apache.org>.
hr342425 commented on PR #13660:
URL: https://github.com/apache/skywalking/pull/13660#issuecomment-3741404220

   Done. I've updated the changes.md. @wu-sheng 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org