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

Test Failure - macOS Too many open files

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.9
    • 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?

      macOS test failed with Too many open files

       [2024/09/05 14:47:06.849] FAILURE: pymongo.errors.WriteError: 24: Too many open files, full error: {'index': 0, 'code': 264, 'errmsg': '24: Too many open files'} ()
       [2024/09/05 14:47:06.849] self = <test.asynchronous.test_client_bulk_write.TestClientBulkWriteCRUD testMethod=test_collects_write_errors_across_batches_ordered>
       [2024/09/05 14:47:06.849]     @async_client_context.require_version_min(8, 0, 0, -24)
       [2024/09/05 14:47:06.849]     @async_client_context.require_no_serverless
       [2024/09/05 14:47:06.849]     async def test_collects_write_errors_across_batches_ordered(self):
       [2024/09/05 14:47:06.849]         listener = OvertCommandListener()
       [2024/09/05 14:47:06.849]         client = await async_rs_or_single_client(event_listeners=[listener])
       [2024/09/05 14:47:06.849]         self.addAsyncCleanup(client.close)
       [2024/09/05 14:47:06.849]     
       [2024/09/05 14:47:06.849]         collection = client.db["coll"]
       [2024/09/05 14:47:06.849]         self.addAsyncCleanup(collection.drop)
       [2024/09/05 14:47:06.849]         await collection.drop()
       [2024/09/05 14:47:06.849] >       await collection.insert_one(document={"_id": 1})
       [2024/09/05 14:47:06.849] test/asynchronous/test_client_bulk_write.py:240: 
       [2024/09/05 14:47:06.849] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
       [2024/09/05 14:47:06.849] pymongo/asynchronous/collection.py:869: in insert_one
       [2024/09/05 14:47:06.849]     await self._insert_one(
       [2024/09/05 14:47:06.849] pymongo/asynchronous/collection.py:809: in _insert_one
       [2024/09/05 14:47:06.849]     await self._database.client._retryable_write(
       [2024/09/05 14:47:06.849] pymongo/asynchronous/mongo_client.py:1877: in _retryable_write
       [2024/09/05 14:47:06.849]     return await self._retry_with_session(retryable, func, s, bulk, operation, operation_id)
       [2024/09/05 14:47:06.849] pymongo/asynchronous/mongo_client.py:1763: in _retry_with_session
       [2024/09/05 14:47:06.849]     return await self._retry_internal(
       [2024/09/05 14:47:06.849] pymongo/_csot.py:110: in csot_wrapper
       [2024/09/05 14:47:06.849]     return await func(self, *args, **kwargs)
       [2024/09/05 14:47:06.849] pymongo/asynchronous/mongo_client.py:1798: in _retry_internal
       [2024/09/05 14:47:06.849]     return await _ClientConnectionRetryable(
       [2024/09/05 14:47:06.849] pymongo/asynchronous/mongo_client.py:2539: in run
       [2024/09/05 14:47:06.849]     return await self._read() if self._is_read else await self._write()
       [2024/09/05 14:47:06.849] pymongo/asynchronous/mongo_client.py:2661: in _write
       [2024/09/05 14:47:06.849]     return await self._func(self._session, conn, self._retryable)  # type: ignore
       [2024/09/05 14:47:06.849] pymongo/asynchronous/collection.py:807: in _insert_command
       [2024/09/05 14:47:06.849]     _check_write_command_response(result)
       [2024/09/05 14:47:06.849] pymongo/helpers_shared.py:285: in _check_write_command_response
       [2024/09/05 14:47:06.849]     _raise_last_write_error(write_errors)
       [2024/09/05 14:47:06.849] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
       [2024/09/05 14:47:06.849] write_errors = [{'code': 264, 'errmsg': '24: Too many open files', 'index': 0}]
       [2024/09/05 14:47:06.849]     def _raise_last_write_error(write_errors: list[Any]) -> NoReturn:
       [2024/09/05 14:47:06.849]         # If the last batch had multiple errors only report
       [2024/09/05 14:47:06.849]         # the last error to emulate continue_on_error.
       [2024/09/05 14:47:06.849]         error = write_errors[-1]
       [2024/09/05 14:47:06.849]         if error.get("code") == 11000:
       [2024/09/05 14:47:06.849]             raise DuplicateKeyError(error.get("errmsg"), 11000, error)
       [2024/09/05 14:47:06.849] >       raise WriteError(error.get("errmsg"), error.get("code"), error)
       [2024/09/05 14:47:06.849] E       pymongo.errors.WriteError: 24: Too many open files, full error: {'index': 0, 'code': 264, 'errmsg': '24: Too many open files'}
       [2024/09/05 14:47:06.849] pymongo/helpers_shared.py:256: WriteError
      

      https://spruce.mongodb.com/task/mongo_python_driver_test_macos__platform~macos_auth~auth_ssl~ssl_test_latest_sharded_cluster_29bbf77dad0867ca19bf9769ca3fddc19cadec23_24_09_05_21_18_48?execution=0&sortBy=STATUS&sortDir=ASC

      This could either be that mongod is mistakenly configured with ulimit too low or because we're leaking files in the test suite.

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

              Created:
              Updated:
              Resolved: