Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1108

multithread with multiple mongos issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.2.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      pymongo on linux
      python 2.7
      sharded db, multiple mongos

      Description

      We are connecting to a db with an url like
      mongodb://mongoservers.domain.com/db
      where mongoservers.domain.com translates into many A records, each pointing to a different server having a mongos configured on the db.

      If I the run a program that starts multiple threads using this db handle, some of them crash within find cursor with this message :
      CursorNotFound: Cursor not found, cursor id: 45616940038

      full traceback:

      Traceback (most recent call last):
      File "test_crash_pymongo.py", line 23, in query_airports
      for a in airports:
      File "/home/pythonenv/falcon/lib/python2.7/site-packages/pymongo/cursor.py", line 1090, in next
      if len(self.__data) or self._refresh():
      File "/home/pythonenv/falcon/lib/python2.7/site-packages/pymongo/cursor.py", line 1032, in _refresh
      self.__max_await_time_ms))
      File "/home/pythonenv/falcon/lib/python2.7/site-packages/pymongo/cursor.py", line 903, in __send_message
      codec_options=self.__codec_options)
      File "/home/pythonenv/falcon/lib/python2.7/site-packages/pymongo/helpers.py", line 114, in _unpack_response
      raise CursorNotFound(msg, 43, errobj)
      CursorNotFound: Cursor not found, cursor id: 45616940038

      Attached is a demonstrator. The collection used here contains about 12000 records.

      There is no problem if the url points to a single mongos.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              behackett Bernie Hackett
              Reporter:
              rj-10gen@arsynet.com Remi Jolin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: