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

Inelegant abend when cannot bind() TCP 27017 at startup

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.7.8
    • Fix Version/s: 2.8.0-rc5
    • Component/s: Networking, Storage
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Run one mongod bound to 27017: ./mongod --dbpath /foo --storageEngine wiredtiger

      Try to start a second one (not sure if storage engine is a factor):
      ./mongod --dbpath /foo --storageEngine wiredtiger

      [observe an assertion and stack trace before exiting]

      Show
      Run one mongod bound to 27017: ./mongod --dbpath /foo --storageEngine wiredtiger Try to start a second one (not sure if storage engine is a factor): ./mongod --dbpath /foo --storageEngine wiredtiger [observe an assertion and stack trace before exiting]

      Description

      Stumbled upon this abend when starting a mongod after another mongod process was already running and bound to TCP 27017.

      Tested using mongodb/mongo (491a9728d381328ad2e0604eb31cec1590418755) standalone, locally compiled approach on Linux.

      [qconner@slave-6.perf.ny.cbi ~/mongo]$ ./mongod --dbpath ~/db --storageEngine wiredtiger
      2014-11-06T22:20:50.347+0000 I CONTROL  [initandlisten] MongoDB starting : pid=29933 port=27017 dbpath=/home/qconner/db 64-bit host=slave-6.perf.ny.cbi.10gen.cc
      2014-11-06T22:20:50.347+0000 I CONTROL  [initandlisten]
      2014-11-06T22:20:50.347+0000 I CONTROL  [initandlisten] ** NOTE: This is a development version (2.7.9-pre-) of MongoDB.
      2014-11-06T22:20:50.347+0000 I CONTROL  [initandlisten] **       Not recommended for production.
      2014-11-06T22:20:50.347+0000 I CONTROL  [initandlisten]
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten]
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten] ** WARNING: You are running on a NUMA machine.
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten] **          We suggest launching mongod like this to avoid performance problems:
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten] **              numactl --interleave=all mongod [other options]
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten]
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten] db version v2.7.9-pre-
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten] git version: 491a9728d381328ad2e0604eb31cec1590418755
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten] build info: Linux slave-6.perf.ny.cbi.10gen.cc 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 BOOST_LIB_VERSION=1_49
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten] allocator: tcmalloc
      2014-11-06T22:20:50.348+0000 I CONTROL  [initandlisten] options: { storage: { dbPath: "/home/qconner/db", engine: "wiredtiger" } }
      2014-11-06T22:20:50.348+0000 E NETWORK  [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
      2014-11-06T22:20:50.348+0000 E NETWORK  [initandlisten]   addr already in use
      2014-11-06T22:20:50.348+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=25G,session_max=20000,extensions=[local=(entry=index_collator_extension)],statistics=(all),log=(enabled=true,archive=true,path=journal),checkpoint=(wait=60,log_size=2GB),
      2014-11-06T22:20:55.353+0000 E STORAGE  [initandlisten] WiredTiger (16) [1415312455:353066][29933:0x7fd4e2f81b40], wiredtiger_open: WiredTiger database is already being managed by another process: Device or resource busy
      2014-11-06T22:20:55.353+0000 I -        [initandlisten] Fatal assertion 28519 UnknownError 16: Device or resource busy
      2014-11-06T22:20:55.364+0000 I CONTROL  [initandlisten]
       0xfd447e 0xf85eaf 0xf701e9 0xdf96fb 0xdfae26 0xdf99bd 0xac019d 0x8006e7 0x8017a9 0x8023a9 0x7fd4e1c2fd1d 0x7fd429
      ----- BEGIN BACKTRACE -----
      {"backtrace":[{"b":"400000","o":"BD447E"},{"b":"400000","o":"B85EAF"},{"b":"400000","o":"B701E9"},{"b":"400000","o":"9F96FB"},{"b":"400000","o":"9FAE26"},{"b":"400000","o":"9F99BD"},{"b":"400000","o":"6C019D"},{"b":"400000","o":"4006E7"},{"b":"400000","o":"4017A9"},{"b":"400000","o":"4023A9"},{"b":"7FD4E1C11000","o":"1ED1D"},{"b":"400000","o":"3FD429"}],"processInfo":{ "mongodbVersion" : "2.7.9-pre-", "gitVersion" : "491a9728d381328ad2e0604eb31cec1590418755", "uname" : { "sysname" : "Linux", "release" : "2.6.32-431.el6.x86_64", "version" : "#1 SMP Fri Nov 22 03:15:09 UTC 2013", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000", "buildId" : "1C2EAEB458497C7318E99ABF64B13C74F6DB41B4" }, { "b" : "7FFFE6EFF000", "elfType" : 3, "buildId" : "81A81BE2E44C93640ADEDB62ADC93A47F4A09DD1" }, { "b" : "7FD4E2B51000", "path" : "/lib64/libpthread.so.0", "elfType" : 3, "buildId" : "211321F78CA244BE2B2B1B8584B460F9933BA76B" }, { "b" : "7FD4E2949000", "path" : "/lib64/librt.so.1", "elfType" : 3, "buildId" : "B26528BF6C0636AC1CAE5AC50BDBC07E60851DF4" }, { "b" : "7FD4E2745000", "path" : "/lib64/libdl.so.2", "elfType" : 3, "buildId" : "AFC7448F2F2F6ED4E5BC82B1BD8A7320B84A9D48" }, { "b" : "7FD4E243F000", "path" : "/usr/lib64/libstdc++.so.6", "elfType" : 3, "buildId" : "ED99110E629209C5CA6C0ED704F2C5CE3171513A" }, { "b" : "7FD4E21BB000", "path" : "/lib64/libm.so.6", "elfType" : 3, "buildId" : "98B028A725D6E93253F25DF00B794DFAA66A3145" }, { "b" : "7FD4E1FA5000", "path" : "/lib64/libgcc_s.so.1", "elfType" : 3, "buildId" : "A44499D29B114A5366CD72DD4883958495AC1C1D" }, { "b" : "7FD4E1C11000", "path" : "/lib64/libc.so.6", "elfType" : 3, "buildId" : "91D435CBF18DF05134203B0A7F7919718DBD1D75" }, { "b" : "7FD4E2D6E000", "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3, "buildId" : "57BF668F99B7F5917B8D55FBB645173C9A644575" } ] }}
       mongod(_ZN5mongo15printStackTraceERSo+0x2E) [0xfd447e]
       mongod(_ZN5mongo10logContextEPKc+0xDF) [0xf85eaf]
       mongod(_ZN5mongo23fassertFailedWithStatusEiRKNS_6StatusE+0xD9) [0xf701e9]
       mongod(_ZN5mongo13invariantWTOKEi+0x2B) [0xdf96fb]
       mongod(_ZN5mongo18WiredTigerKVEngineC2ERKSsS2_b+0x626) [0xdfae26]
       mongod(+0x9F99BD) [0xdf99bd]
       mongod(_ZN5mongo23GlobalEnvironmentMongoD22setGlobalStorageEngineERKSs+0x17D) [0xac019d]
       mongod(_ZN5mongo13initAndListenEi+0x637) [0x8006e7]
       mongod(+0x4017A9) [0x8017a9]
       mongod(main+0x9) [0x8023a9]
       libc.so.6(__libc_start_main+0xFD) [0x7fd4e1c2fd1d]
       mongod(+0x3FD429) [0x7fd429]
      -----  END BACKTRACE  -----
      2014-11-06T22:20:55.364+0000 I -        [initandlisten]
       
      ***aborting after fassert() failure
       
       
      2014-11-06T22:20:55.369+0000 F -        [initandlisten] Got signal: 6 (Aborted).
       
       0xfd447e 0xfd3f08 0xfd41f1 0x7fd4e1c439a0 0x7fd4e1c43925 0x7fd4e1c45105 0xf70277 0xdf96fb 0xdfae26 0xdf99bd 0xac019d 0x8006e7 0x8017a9 0x8023a9 0x7fd4e1c2fd1d 0x7fd429

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mark.benvenuto Mark Benvenuto
              Reporter:
              quentin.conner Quentin Conner
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: