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

AssertionError on insert during primary election

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.7
    • Affects Version/s: 2.6.3
    • Component/s: None
    • None
    • Environment:

      Posted as a question on Stack Overflow: http://stackoverflow.com/questions/20200179/mongoreplicasetclient-fails-unexpectedly-during-primary-re-election

      Attempt to insert document into database during primary election using MongoReplicaSetClient leads to AssertionError:

      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/zero323/.virtualenvs/mg/local/lib/python2.7/site-packages/pymongo/collection.py", line 360, in insert
      self.database.connection)
      File "/home/zero323/.virtualenvs/mg/local/lib/python2.7/site-packages/pymongo/mongo_replica_set_client.py", line 1491, in _send_message
      member.pool.maybe_return_socket(sock_info)
      File "/home/zero323/.virtualenvs/mg/local/lib/python2.7/site-packages/pymongo/pool.py", line 397, in maybe_return_socket
      assert sock_info not in (NO_REQUEST, NO_SOCKET_YET)
      AssertionError

      Possibly related to https://jira.mongodb.org/browse/PYTHON-594?jql=text%20~%20%22AssertionError%22

      Steps to reproduce:

      • connect to 3 member replica set using MongoReplicaSetClient
      • kill primary
      • attempt to insert document before re-election is finished

      Tested with pymongo 2.6.3 and pymongo 2.6+ (b62750971c93152e69fc560afe9b7face24d46f8).

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            zero323 Matthew Szymkiewicz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: