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

Support keep-alive for TCP, HTTP requests

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • None
    • None
    • library
    • None

    Description

      Support has reported issues running in Azure environments, where the Azure VM idle timeout appears to be killing connections that do not have a keep-alive configured.

      In Sync Gateway 1.4, the fix for this (via go-couchbase) is to:

      1. Call SetKeepAlive and SetKeepAlivePeriod on the memcached TCPConn.
      2. Use the DefaultTransport as the starting point when creating an HTTPClient, to pick up the default DialContext settings. (https://golang.org/pkg/net/http/#RoundTripper)

      I don't believe gocb currently supports either of the above two options.

      For TCP, keep alive isn't being set:
      https://github.com/couchbase/gocbcore/blob/ace0f2ec0d007700390c2eb073a6a7fc9ee58f2d/memdconn.go#L41

      For HTTP, gocb builds a custom transport from scratch that doesn't include DialContext settings:
      https://github.com/couchbase/gocbcore/blob/v7/agent.go#L335

      From previous conversations with Brett Lawson, this may be by design on the TCP side, but I'd like to hear more specifics about why that's not needed to support something like the Azure environment.

      Attachments

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

        Activity

          People

            brett19 Brett Lawson
            adamf Adam Fraser
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty