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

Goroutine leak in query engine on syntax error.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • bug-backlog
    • 4.0.0
    • query
    • Security Level: Public
    • None
    • Untriaged
    • Unknown

    Description

      The generated lexer code creates a goroutine which is occasionally leaked;

      A test with 1800 requests showed 200 live instances of it at the end.
      A test with 3600 requests showed 400 live instances of it at the end.

      The goroutine in question is created by n1ql.NewLexerWithInit. Example:

      goroutine 579 [chan send, 6 minutes]:
      github.com/couchbase/query/parser/n1ql.funcĀ·004(0xc2081192c0, 0xc208119260, 0xc208bfa000, 0xc7, 0xc7, 0x0, 0xb)
      /Users/colm/src/github.com/couchbase/query/parser/n1ql/n1ql.nn.go:134 +0x9c8
      created by github.com/couchbase/query/parser/n1ql.NewLexerWithInit
      /Users/colm/src/github.com/couchbase/query/parser/n1ql/n1ql.nn.go:19870 +0x39192

      This is actually generated code (by the 3rd party nex tool).

      To reproduce, run query engine with pprof enabled (per https://golang.org/pkg/net/http/pprof/#pkg-overview), and view the live goroutine dump at the end of a test run of queries:
      http://localhost:6060/debug/pprof/goroutine?debug=2

      Attachments

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

        Activity

          People

            isha Isha Kandaswamy (Inactive)
            colm Colm Mchugh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty