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

Long hang time with mongo.find()

    • Type: Icon: Improvement Improvement
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.10
    • Component/s: Query Operations
    • None
    • Environment:
      Python 3.5

      Hello, I'm having an issue withthe db.find() function. I'm running a for each loop(see below code for format) and get stuck at the 101st element every time, where it hangs for about 10s. After hanging for the 10s it goes through the other elements just fine. I tried using a large batch size on the query but it just shifts that 10s hanging and makes the first element hang for about 10s. I'm running this in pycharm(if that's relavent).
      I've looked at similar tickets and:
      py.has_c() = True

      The code where it hangs is a for each loop in the below format:

       

      query_results = database.find(query)
      for
      x in query_results: # after getting to the 101st element, it hangs here
            *relavent code executed*

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            andrej.glavic.can@gmail.com Andrej Glavic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: