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

python3.13t async test failed with RuntimeError: Lock is not acquired

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Python Drivers
    • 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?
    • None
    • None
    • None
    • None
    • None
    • None

      An async test failed with "RuntimeError: Lock is not acquired" in github actions with python3.13t:

      FAILED test/asynchronous/test_session.py::TestSession::test_end_sessions - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <coroutine object _AsyncGeneratorContextManager.__aenter__ at 0x51cd9ab3f00>
      
      Traceback (most recent call last):
        File "/home/runner/work/mongo-python-driver/mongo-python-driver/pymongo/asynchronous/pool.py", line 1474, in _get_conn
          if not await _async_cond_wait(self.size_cond, timeout):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      GeneratorExit
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/runner/.local/share/uv/python/cpython-3.13.2+freethreaded-linux-x86_64-gnu/lib/python3.13t/contextlib.py", line 214, in __aenter__
          return await anext(self.gen)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/home/runner/work/mongo-python-driver/mongo-python-driver/pymongo/asynchronous/pool.py", line 1355, in checkout
          conn = await self._get_conn(checkout_started_time, handler=handler)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/runner/work/mongo-python-driver/mongo-python-driver/pymongo/asynchronous/pool.py", line 1470, in _get_conn
          async with self.size_cond:
                     ^^^^^^^^^^^^^^
        File "/home/runner/.local/share/uv/python/cpython-3.13.2+freethreaded-linux-x86_64-gnu/lib/python3.13t/asyncio/locks.py", line 20, in __aexit__
          self.release()
          ~~~~~~~~~~~~^^
        File "/home/runner/.local/share/uv/python/cpython-3.13.2+freethreaded-linux-x86_64-gnu/lib/python3.13t/asyncio/locks.py", line 142, in release
      Error:     raise RuntimeError('Lock is not acquired.')
      RuntimeError: Lock is not acquired.
      

      https://github.com/mongodb/mongo-python-driver/actions/runs/13577449794/job/37956811892

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: