Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-49508

XDCR - topologySvc should use timer instead of ticker

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 7.1.0
    • 7.1.0
    • XDCR
    • None
    • 1

    Description

      Looking at logs from MB-48884 on the stuck node, I noticed a bunch of goroutines stuck at a select and not giving up as they should:

      		timeout := time.NewTicker(1 * time.Second)
      		if bw.source {
      			select {   <--
      			case chRaw.(chan service_def.SourceNotification) <- notification:
      			// sent
      			case <-timeout.C:
      				// provide a bail out path
      				notification.Recycle()
      				continue
      			
      

      This should be using a timer instead of a ticker because it's only meant to trigger once.
      According to golang, tickers can

      The ticker will adjust the time interval or drop ticks to make up for slow receivers

      It's very unlikely for the ticker to drop so many ticks but regardless this needs to be a Timer anyway.

      Attachments

        Issue Links

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

          Activity

            People

              neil.huang Neil Huang
              neil.huang Neil Huang
              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