-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.6.3
-
Component/s: None
-
None
-
Environment:{
"version" : "2.4.5",
"gitVersion" : "nogitversion",
"sysInfo" : "Linux bob 3.9-1-amd64 #1 SMP Debian 3.9.8-1 x86_64 BOOST_LIB_VERSION=1_49",
"loaderFlags" : "-fPIC -pthread -rdynamic",
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -fno-builtin-memcmp -O3",
"allocator" : "tcmalloc",
"versionArray" : [
2,
4,
5,
0
],
"javascriptEngine" : "V8",
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}
{ "version" : "2.4.5", "gitVersion" : "nogitversion", "sysInfo" : "Linux bob 3.9-1-amd64 #1 SMP Debian 3.9.8-1 x86_64 BOOST_LIB_VERSION=1_49", "loaderFlags" : "-fPIC -pthread -rdynamic", "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -fno-builtin-memcmp -O3", "allocator" : "tcmalloc", "versionArray" : [ 2, 4, 5, 0 ], "javascriptEngine" : "V8", "bits" : 64, "debug" : false, "maxBsonObjectSize" : 16777216, "ok" : 1 }
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).