Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-16292

mongod isn't ready for connections when it finishes a fork

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0-rc0
    • Component/s: Networking
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Platforms 2016-08-26, Platforms 2016-09-19, Platforms 2016-10-10

      Description

      Not sure which component this is but I have a script which starts mongod and then runs a status command against it:

      Mon Nov 24 02:25:04 CST 2014  Starting mmapv1-ycsb test
      about to fork child process, waiting until server is ready for connections.
      forked process: 26239
      child process started successfully, parent exiting
      2014-11-24T02:26:50.744-0600 W NETWORK  Failed to connect to 127.0.0.1:27077, reason: errno:111 Connection refused
      2014-11-24T02:26:50.746-0600 I QUERY    Error: couldn't connect to server 127.0.0.1:27077 (127.0.0.1), connection attempt failed
          at connect (src/mongo/shell/mongo.js:181:14)
          at (connect):1:21 at src/mongo/shell/mongo.js:181
      exception: connect failed

      Corresponding lines from the log:

      2014-11-24T02:26:50.667-0600 I CONTROL  [initandlisten] MongoDB starting : pid=26239 port=27077 dbpath=/disk1/db/mmapv1-ycsb 64-bit host=asya.mongodb.com
      2014-11-24T02:26:50.668-0600 I CONTROL  [initandlisten] db version v2.8.0-rc2-pre-
      2014-11-24T02:26:50.668-0600 I CONTROL  [initandlisten] git version: e4329ae5e7bfb56ef9b63a8388285b70b7ec9634
      2014-11-24T02:26:50.668-0600 I CONTROL  [initandlisten] build info: Linux build11.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
      2014-11-24T02:26:50.668-0600 I CONTROL  [initandlisten] allocator: tcmalloc
      2014-11-24T02:26:50.668-0600 I CONTROL  [initandlisten] options: { net: { port: 27077 }, processManagement: { fork: true }, storage: { dbPath: "/disk1/db/mmapv1-ycsb", engine: "mmapv1", journal: { enabled: false }
      }, systemLog: { destination: "file", path: "/home/asya/logs/mmapv1-ycsb.log" } }
      2014-11-24T02:26:50.706-0600 I INDEX    [initandlisten] allocating new ns file /disk1/db/mmapv1-ycsb/local.ns, filling with zeroes...
      2014-11-24T02:26:50.732-0600 I STORAGE  [FileAllocator] allocating new datafile /disk1/db/mmapv1-ycsb/local.0, filling with zeroes...
      2014-11-24T02:26:50.732-0600 I STORAGE  [FileAllocator] creating directory /disk1/db/mmapv1-ycsb/_tmp
      2014-11-24T02:26:50.745-0600 I STORAGE  [FileAllocator] done allocating datafile /disk1/db/mmapv1-ycsb/local.0, size: 64MB,  took 0 secs
      2014-11-24T02:26:50.748-0600 I NETWORK  [initandlisten] waiting for connections on port 27077
      2014-11-24T02:26:51.159-0600 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:53032 #1 (1 connection now open)

      You can see that it is waiting for connections as of T02:26:50.748 but it passed control back before T02:26:50.744 as by then the shell already tried to connect again to run command.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              samantha.ritter Samantha Ritter (Inactive)
              Reporter:
              asya Asya Kamsky
              Participants:
              Votes:
              3 Vote for this issue
              Watchers:
              17 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: