Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2438

Pool "closeConnection" method cause panics on removePerishedConns()

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.8.4, 1.9.1
    • Component/s: None
    • None

      Summary

      Sometimes panics occurs and application is restarted.

      Driver versions -> 1.8.4, 1.9.1

      How to Reproduce

      No clear WTR, it's happening from time to time on production deployments

      Additional Background

      Stack trace:

      /app/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/pool.go:772 +0x198
      created by go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*pool).removePerishedConns
      /app/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/pool.go:773 +0x25
      go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*pool).removePerishedConns.func1()
      /app/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/pool.go:400 +0x75
      go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*pool).closeConnection(0xc000714a80?, 0xc0004db400)
      /app/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/connection.go:499 +0x43
      go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*connection).close(0xc0004db400?)
      /usr/local/go/src/crypto/tls/conn.go:1338 +0x69
      crypto/tls.(*Conn).Close(0xc00080d701?)
      /usr/local/go/src/crypto/tls/conn.go:1368 +0xdb
      crypto/tls.(*Conn).closeNotify(0xc00162ea80)
      /usr/local/go/src/crypto/tls/conn.go:151
      crypto/tls.(*Conn).SetWriteDeadline(...)
      /usr/local/go/src/net/net.go:261 +0x48
      net.(*conn).SetWriteDeadline(0xc00000ed10, {0x51b5b106590?, 0x1596c00?, 0x1596c00?})
      /usr/local/go/src/net/fd_posix.go:146
      net.(*netFD).SetWriteDeadline(...)
      /usr/local/go/src/internal/poll/fd_poll_runtime.go:142
      internal/poll.(*FD).SetWriteDeadline(...)
      /usr/local/go/src/internal/poll/fd_poll_runtime.go:160 +0x1be
      internal/poll.setDeadlineImpl(0xc0022c38c0, {0x2?, 0x0?, 0x1596c00?}, 0x4c17b6?)
      /usr/local/go/src/runtime/netpoll.go:324 +0x3e
      internal/poll.runtime_pollSetDeadline(0x2, 0x12a05f0f3, 0x77)
      goroutine 223004 [running]:
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x2 pc=0x46365e]

      Solution:

      Handle panics inside closeConnection function - Pull request

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            andrii.hrachov@deliveryhero.com Andrii Hrachov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: