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

start_request() should allow nesting

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4
    • Affects Version/s: 2.3
    • Component/s: None
    • Labels:
      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
      

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            shadowman131 Walt Woods
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: