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

mongos throws an uncaught socket exception when it can't reach the config server

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.0
    • Affects Version/s: 1.7.6
    • Component/s: Sharding
    • Labels:
      None
    • Environment:
      Linux x86_64
    • Linux

      Repro steps:

      Start mongos with the --configdb parameter referring to a mongod that doesn't exist:

      Fri Jan 28 17:51:17 mongos db version v1.8.0-rc0-pre-, pdfile version 4.5 starting (--help for usage)
      Fri Jan 28 17:51:17 git version: 7fa627b35627e94c94aafe9b0275de665129acd2
      Fri Jan 28 17:51:17 sys info: Linux behackett-dt 2.6.36-gentoo-r5 #4 SMP Mon Jan 24 10:24:02 PST 2011 x86_64 BOOST_LIB_VERSION=1_42
      terminate called after throwing an instance of 'mongo::SocketException'
      what(): socket exception
      Aborted

      I can also reproduce this by passing a configdb that hasn't completely settled down yet. Logging mongos to a file you can see something like this:

      Fri Jan 28 17:41:26 mongos db version v1.8.0-rc0-pre-, pdfile version 4.5 starting (--help for usage)
      Fri Jan 28 17:41:26 git version: 7fa627b35627e94c94aafe9b0275de665129acd2
      Fri Jan 28 17:41:26 sys info: Linux behackett-dt 2.6.36-gentoo-r5 #4 SMP Mon Jan 24 10:24:02 PST 2011 x86_64 BOOST_LIB_VERSION=1_42
      Received signal 6
      Backtrace: 0x50ba14 0x7f6f3609d1e0 0x7f6f3609d165 0x7f6f3609e580 0x7f6f378b65d5 0x7f6f378b4a06 0x7f6f378b4a33 0x7f6f378b4b2e 0x51046e 0x510819 0x5a70dd 0x61736b 0x611e38 0x7f6f36089bbd 0x48ecb9
      mongos(_ZN5mongo17printStackAndExitEi+0x64)[0x50ba14]
      /lib/libc.so.6(+0x321e0)[0x7f6f3609d1e0]
      /lib/libc.so.6(gsignal+0x35)[0x7f6f3609d165]
      /lib/libc.so.6(abort+0x180)[0x7f6f3609e580]
      /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6(ZN9gnu_cxx27_verbose_terminate_handlerEv+0x115)[0x7f6f378b65d5]
      /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6(+0xcaa06)[0x7f6f378b4a06]
      /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6(+0xcaa33)[0x7f6f378b4a33]
      /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6(+0xcab2e)[0x7f6f378b4b2e]
      mongos(_ZN5mongo16DBConnectionPool3getERKSs+0x34e)[0x51046e]
      mongos(_ZN5mongo18ScopedDbConnectionC1ERKNS_5ShardE+0x89)[0x510819]
      mongos(_ZN5mongo12ConfigServer15dbConfigVersionEv+0x1d)[0x5a70dd]
      mongos(_ZN5mongo12ConfigServer18checkConfigVersionEb+0x1b)[0x61736b]
      mongos(main+0x1648)[0x611e38]
      /lib/libc.so.6(__libc_start_main+0xfd)[0x7f6f36089bbd]
      mongos[0x48ecb9]
      ===

            Assignee:
            Unassigned Unassigned
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: