Uploaded image for project: 'Couchbase Go SDK'
  1. Couchbase Go SDK
  2. GOCBC-1338

Use aligned 64-bit values in lazyCircuitBreaker

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 2.5.3, core-10.1.5
    • None
    • None
    • None
    • 1
    • SDK35

    Description

      https://forums.couchbase.com/t/go-sdk-panics-with-unaligned-64-bit-atomic-operation-on-x86-64-ubuntu-server/34124

       

      Something like:

       

      --- a/circuitbreaker.go
      +++ b/circuitbreaker.go
      @@ -80,15 +80,15 @@ func (ncb *noopCircuitBreaker) CanaryTimeout() time.Duration {
       
       type lazyCircuitBreaker struct {
           state                    uint32
      -    windowStart              int64
      -    sleepWindow              int64
      -    rollingWindow            int64
      -    volumeThreshold          int64
      +    windowStart              atomic.AlignedInt64
      +    sleepWindow              atomic.AlignedInt64
      +    rollingWindow            atomic.AlignedInt64
      +    volumeThreshold          atomic.AlignedInt64
           errorPercentageThreshold float64
           canaryTimeout            time.Duration
      -    total                    int64
      -    failed                   int64
      -    openedAt                 int64
      +    total                    atomic.AlignedInt64
      +    failed                   atomic.AlignedInt64
      +    openedAt                 atomic.AlignedInt64
           sendCanaryFn             func()
           completionCallback       CircuitBreakerCallback
       }
       
      

      perhaps?

       

      Attachments

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

        Activity

          People

            jack.westwood Jack Westwood
            Donald.haggart Donald Haggart
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty