-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.3
-
Component/s: None
-
None
When using a connection with auto_start_request = False, if nested methods use start_request() separately, and the calling method also uses a start_request(), then the calling method's request is ended by the first nested method.
For example, the following bit of code uses more than one socket, even though it should only use one:
c = pymongo.Connection(auto_start_request = False)
with c.start_request():
with c.start_request():
print(c._Connection__socket())
print(c._Connection__socket())
print(c._Connection__socket()) # This socket is different, but is still
# inside of outer request