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

Lazy loading modules is not thread-safe

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.7.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Context

      https://github.com/python/cpython/issues/114763 uncovered that lazily-loaded modules cannot have their attributes accessed in a thread-safe manner. This was fixed in Python 3.11.9 and Python 3.12.  

      Definition of done

      Our lazy-loading code should check to verify that the user is using a thread-safe version of Python before running.

      Pitfalls

      N/A.

            Assignee:
            steve.silvester@mongodb.com Steve Silvester
            Reporter:
            noah.stapp@mongodb.com Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: