start_request() should allow nesting

XMLWordPrintableJSON

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

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

              Created:
              Updated:
              Resolved: