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

Goroutine leak after bucket.Close

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.3
    • Fix Version/s: 1.2.4
    • Component/s: library
    • Labels:
      None

      Description

      Stray goroutine lingering around post bucket close

      1 @ 0x102e02a 0x102e10e 0x10059bd 0x10056cd 0x13471a3 0x1059c61
      #   0x13471a2   gopkg.in/couchbase/gocbcore%2ev7.(*memdClient).run.func1+0x392  /Users/asingh/gosrc/src/gopkg.in/couchbase/gocbcore.v7/memdclient.go:101
      

      Standalone program to replicate the issue attached.

        Attachments

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

          Activity

          Hide
          brett19 Brett Lawson added a comment -

          Unfortunately, due to the asynchronous nature of the Go SDK, after you call Close and it returns, some of the goroutines will still be in the process of shutting down.

          Show
          brett19 Brett Lawson added a comment - Unfortunately, due to the asynchronous nature of the Go SDK, after you call Close and it returns, some of the goroutines will still be in the process of shutting down.
          Hide
          asingh Abhishek Singh added a comment - - edited

          Reopening this bug as I don't want this to fall off the radar.

          Even after waiting for long time, routines don't clean up. Ideally from a sdk library one would expect to have all necessary handles to gracefully cleanup routines on bucket.Close(). In present scenario with eventing when lambdas are (re)deployed(it would tear down old setup and create new one) quite a few times during tests, it's common to notice that gocb sdk is leaking 50+ goroutines. Not sure why any other gocb consumer is reporting this pain point.(Note: similar issue doesn't show with go-couchbase)

          Prime reason, eventing chose gocb is because of support for xattr via subdoc operation. But if this problem isn't getting addressed then we might have to look into porting subdoc support in go-couchbase(ideally we don't want to duplicate the effort for something that's already in place in gocb).

          Show
          asingh Abhishek Singh added a comment - - edited Reopening this bug as I don't want this to fall off the radar. Even after waiting for long time, routines don't clean up. Ideally from a sdk library one would expect to have all necessary handles to gracefully cleanup routines on bucket.Close(). In present scenario with eventing when lambdas are (re)deployed(it would tear down old setup and create new one) quite a few times during tests, it's common to notice that gocb sdk is leaking 50+ goroutines. Not sure why any other gocb consumer is reporting this pain point.(Note: similar issue doesn't show with go-couchbase) Prime reason, eventing chose gocb is because of support for xattr via subdoc operation. But if this problem isn't getting addressed then we might have to look into porting subdoc support in go-couchbase(ideally we don't want to duplicate the effort for something that's already in place in gocb).
          Hide
          build-team Couchbase Build Team added a comment -

          Build 5.0.0-3507 contains gocbcore commit c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776 with commit message:
          GOCBC-205: Fixed memdClient leaking goroutines.
          https://github.com/couchbase/gocbcore/commit/c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776

          Show
          build-team Couchbase Build Team added a comment - Build 5.0.0-3507 contains gocbcore commit c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776 with commit message: GOCBC-205 : Fixed memdClient leaking goroutines. https://github.com/couchbase/gocbcore/commit/c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776
          Hide
          build-team Couchbase Build Team added a comment -

          Build 5.0.1-4671 contains gocbcore commit c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776 with commit message:
          GOCBC-205: Fixed memdClient leaking goroutines.
          https://github.com/couchbase/gocbcore/commit/c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776

          Show
          build-team Couchbase Build Team added a comment - Build 5.0.1-4671 contains gocbcore commit c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776 with commit message: GOCBC-205 : Fixed memdClient leaking goroutines. https://github.com/couchbase/gocbcore/commit/c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776
          Hide
          build-team Couchbase Build Team added a comment -

          Build 5.1.0-1448 contains gocbcore commit c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776 with commit message:
          GOCBC-205: Fixed memdClient leaking goroutines.
          https://github.com/couchbase/gocbcore/commit/c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776

          Show
          build-team Couchbase Build Team added a comment - Build 5.1.0-1448 contains gocbcore commit c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776 with commit message: GOCBC-205 : Fixed memdClient leaking goroutines. https://github.com/couchbase/gocbcore/commit/c088f44b4c8e2a9cad2c7ab8dcf077b06e1d8776

            People

            • Assignee:
              brett19 Brett Lawson
              Reporter:
              asingh Abhishek Singh
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.