Gregory Hunt

09/06/2023, 2:17 PM
I am getting this error in my process workers and it is cause the worker to crash and hang flow runs in a pending or running state
Copy code
Traceback (most recent call last):
  File "/opt/venv/lib/python3.9/site-packages/prefect/cli/", line 41, in wrapper
    return fn(*args, **kwargs)
  File "/opt/venv/lib/python3.9/site-packages/prefect/utilities/", line 255, in coroutine_wrapper
    return call()
  File "/opt/venv/lib/python3.9/site-packages/prefect/_internal/concurrency/", line 383, in __call__
    return self.result()
  File "/opt/venv/lib/python3.9/site-packages/prefect/_internal/concurrency/", line 283, in result
    return self.future.result(timeout=timeout)
  File "/opt/venv/lib/python3.9/site-packages/prefect/_internal/concurrency/", line 169, in result
    return self.__get_result()
  File "/usr/lib/python3.9/concurrent/futures/", line 389, in __get_result
    raise self._exception
  File "/opt/venv/lib/python3.9/site-packages/prefect/_internal/concurrency/", line 346, in _run_async
    result = await coro
  File "/opt/venv/lib/python3.9/site-packages/prefect/cli/", line 178, in start
  File "/opt/venv/lib/python3.9/site-packages/anyio/_backends/", line 597, in __aexit__
    raise exceptions[0]
  File "/opt/venv/lib/python3.9/site-packages/prefect/utilities/", line 53, in critical_service_loop
    await workload()
  File "/opt/venv/lib/python3.9/site-packages/prefect/workers/", line 529, in get_and_submit_flow_runs
    return await self._submit_scheduled_flow_runs(flow_run_response=runs_response)
  File "/opt/venv/lib/python3.9/site-packages/prefect/workers/", line 738, in _submit_scheduled_flow_runs
  File "/opt/venv/lib/python3.9/site-packages/anyio/_backends/", line 1846, in acquire_on_behalf_of_nowait
    raise RuntimeError(
RuntimeError: this borrower is already holding one of this CapacityLimiter's tokens

Bianca Hoch

09/06/2023, 3:57 PM
Hi Gregory, thanks for reporting this. Another user reported a similar error this morning and created an issue here. Would you be willing to create a separate issue, or comment on the original detailing the behavior that you're seeing?

Gregory Hunt

09/06/2023, 4:52 PM
I commented on the issue