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

Close connections for which no thread can be allocated

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.13
    • Affects Version/s: None
    • Component/s: Internal Code
    • Fully Compatible
    • ALL
    • Platform 6 07/17/15, Platforms 2017-08-21, Platforms 2017-09-11

      Under some circustances, if too many connections are open, pthread_create() call in mongosMain might fail with EAGAIN.
      mongos doesn't properly handle boost::thread_resource_error exception and terminates. Maybe it could just refuse the connection and keep running.

      Trace example:

      2014-05-01T13:17:57.114-0700 [mongosMain] pthread_create failed: errno:11 Resource temporarily unavailable
      2014-05-01T13:17:57.114-0700 [mongosMain] can't create new thread, closing connection
      2014-05-01T13:17:57.116-0700 [conn973] DBClientCursor::init call() failed
      2014-05-01T13:17:57.116-0700 [mongosMain] connection accepted from 127.0.0.1:43764 #980 (167 connections now open)
      2014-05-01T13:17:57.116-0700 [mongosMain] pthread_create failed: errno:11 Resource temporarily unavailable
      2014-05-01T13:17:57.116-0700 [mongosMain] can't create new thread, closing connection
      2014-05-01T13:17:57.118-0700 [conn861] DBClientCursor::init call() failed
      2014-05-01T13:17:57.120-0700 [conn927] DBClientCursor::init call() failed
      2014-05-01T13:17:57.127-0700 [conn976] ERROR: Uncaught std::exception: boost::thread_resource_error, terminating
      2014-05-01T13:17:57.127-0700 [conn976] dbexit: rc:100
      

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            davide.italiano Davide Italiano
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: