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

start_request() should allow nesting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: