Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-1432

LazyCircuitBreaker does not handle System.nanoTime overflow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0.0-beta.1
    • 3.0.0-alpha.7
    • None
    • None
    • 1

    Description

      The code currently assumes System.nanoTime is positive and never overflows.

      From the System.nanoTime() javadoc:

      To compare two nanoTime values
       
       long t0 = System.nanoTime();
       ...
       long t1 = System.nanoTime();
       
      one should use t1 - t0 < 0, not t1 < t0, because of the possibility of numerical overflow.
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            david.nault David Nault
            david.nault David Nault
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty