Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1643

MongoDB ignores reconnect configuration for initial connection

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.1.3
    • Component/s: None

      Expected Behaviour:

      If the mongo server was not available on initial connect, the `reconnect` connection settings would attempt to `reconnect` to the database, until successful or until the retries were exhausted.

      Actual Behaviour:

      If the mongo server was not available on initial connect, the connection fails, and there is no further attempt to reconnect to the database, despite the presence of `reconnect` options.

      e.g.

      failed to connect to server [db:27017] on first connect

      Context:

      This is a especially a problem for virtual environments, where there is no guarantee that the mongo server has started before other containers.

       

      I'm currently using the following promise-retry library, as a workaround to mimic the desired `reconnect` behaviour on startup.

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            nickg Nick G
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: