def _vespa_deployment_lock(self):
        """A context manager that manages an optional distributed lock.

        If the _enable_index_operations flag is set to True, the context manager tries to acquire the deployment lock.
            If the lock is acquired, the context manager yields
            If the lock cannot be acquired before the timeout, it raises an OperationConflictError.
            If the lock is None, the context manager yields without locking
        If the _enable_index_operations flag is set to False, the context manager raises an InternalError during
            index operations.

        Raises:
            OperationConflictError: If another index creation/deletion operation is
                in progress and the lock cannot be acquired
            InternalError: If index_management object is not enabled for index operations
        """
        if not self._enable_index_operations:
            raise InternalError("You index_management object is not enabled for index operations. ")

        if self._zookeeper_deployment_lock is None:
            logger.warning(f"No Zookeeper client provided. "
                           f"Concurrent index operations may result in race conditions. ")
            yield  # No lock, proceed without locking
        else:
            try:
                with self._zookeeper_deployment_lock:
                    logger.debug(f"Retrieved the distributed lock for index operations. ")
                    yield
            except ZookeeperLockNotAcquiredError:
                # TODO add a doclink for troubleshooting this issue
                raise OperationConflictError("Your indexes are being updated. Please try again shortly.")
A context manager that manages an optional distributed lock.

        If the _enable_index_operations flag is set to True, the context manager tries to acquire the deployment lock.
            If the lock is acquired, the context manager yields
            If the lock cannot be acquired before the timeout, it raises an OperationConflictError.
            If the lock is None, the context manager yields without locking
        If the _enable_index_operations flag is set to False, the context manager raises an InternalError during
            index operations.

        Raises:
            OperationConflictError: If another index creation/deletion operation is
                in progress and the lock cannot be acquired
            InternalError: If index_management object is not enabled for index operations
        
src/marqo/core/index_management/index_management.py