You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "hiSandog (via GitHub)" <gi...@apache.org> on 2026/06/11 02:06:26 UTC

[PR] fix: round relative time seconds exactly [pulsar]

hiSandog opened a new pull request, #25994:
URL: https://github.com/apache/pulsar/pull/25994

   ## Motivation
   RelativeTimeUtil.nsToSeconds currently builds a BigDecimal from a double. For half-up rounding cases such as 1.2345 seconds, the binary double value can be slightly below the decimal half and round down unexpectedly.
   
   ## Modifications
   - Convert nanoseconds with BigDecimal.valueOf(ns, 9) so the decimal value is exact before rounding.
   - Apply the same fix to both common and cli-utils RelativeTimeUtil implementations.
   - Add coverage for a half-up rounding boundary.
   
   ## Verifications
   - git diff --check
   - Not run: ./gradlew :pulsar-common:test --tests "org.apache.pulsar.common.util.RelativeTimeUtilTest" -PtestRetryCount=0 (local environment has no Java Runtime)


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [PR] fix: round relative time seconds exactly [pulsar]

Posted by "hiSandog (via GitHub)" <gi...@apache.org>.
hiSandog closed pull request #25994: fix: round relative time seconds exactly
URL: https://github.com/apache/pulsar/pull/25994


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [PR] fix: round relative time seconds exactly [pulsar]

Posted by "hiSandog (via GitHub)" <gi...@apache.org>.
hiSandog commented on PR #25994:
URL: https://github.com/apache/pulsar/pull/25994#issuecomment-4806114278

   Closing this as part of PR maintenance because it is more than 15 full days old. I am leaving the branch intact.


-- 
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: commits-unsubscribe@pulsar.apache.org

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