Skip to content

Conversation

bjmi
Copy link
Contributor

@bjmi bjmi commented Oct 8, 2025

This change addresses the elapsed time computation in OptimisticEmitFailureHandler due to the possibility of a numerical overflow. The described behavior isn't changed from user's perspective.

Javadoc of System.nanoTime() explicitly mentions how to measure elapsed time.

To compare elapsed time against a timeout, use
if (System.nanoTime() - startTime >= timeoutNanos) ...
instead of
if (System.nanoTime() >= startTime + timeoutNanos) ...
because of the possibility of numerical overflow.

See System.nanoTime()

@bjmi bjmi requested a review from a team as a code owner October 8, 2025 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant