Comfy-Org/ComfyUI · info · ProcessingInterrupted

Task cancelled

Error message

Task cancelled

What it means

The download helper races the HTTP request against an interrupt monitor task. If the monitor completes first (the user cancelled or interrupted the ComfyUI execution) while the request is still pending, the request is cancelled and ProcessingInterrupted('Task cancelled') is raised. This is intentional cancellation propagation, not a failure.

Source

Thrown at comfy_api_nodes/util/download_helpers.py:106

            async def _monitor():
                try:
                    while not stop_evt.is_set():
                        if is_processing_interrupted():
                            return
                        await asyncio.sleep(1.0)
                except asyncio.CancelledError:
                    return

            monitor_task = asyncio.create_task(_monitor())

            req_task = asyncio.create_task(session.get(to_aiohttp_url(url), headers=headers))
            done, pending = await asyncio.wait({req_task, monitor_task}, return_when=asyncio.FIRST_COMPLETED)

            if monitor_task in done and req_task in pending:
                req_task.cancel()
                with contextlib.suppress(Exception):
                    await req_task
                raise ProcessingInterrupted("Task cancelled")

            try:
                resp = await req_task
            except asyncio.CancelledError:
                raise ProcessingInterrupted("Task cancelled") from None

            async with resp:
                if resp.status >= 400:
                    with contextlib.suppress(Exception):
                        try:
                            body = await resp.json()
                        except (ContentTypeError, ValueError):
                            text = await resp.text()
                            body = text if len(text) <= 4096 else f"[text {len(text)} bytes]"
                        request_logger.log_request_response(
                            operation_id=op_id,
                            request_method="GET",
                            request_url=url,

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. No fix needed if the cancellation was intentional — this is expected behavior.
  2. If cancellations happen unexpectedly, check whether another session/client is clearing the queue.
  3. Re-run the workflow after the interruption cause is resolved.
  4. Node authors should let ProcessingInterrupted propagate; do not catch-and-continue past it.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    await download(...)
except ProcessingInterrupted:
    # user cancelled: stop cleanly, keep partial state, do not retry
    raise

Prevention

When it happens

Trigger: User hits Cancel/interrupt in the ComfyUI UI (or the queue is cleared) while a GET download in comfy_api_nodes/util/download_helpers.py is still awaiting connection/response headers.

Common situations: Cancelling a long-running API-node workflow during its media download phase; queue interruption from another client; frontend-driven execution abort.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/2e6d0184008b366e. Report an issue: GitHub.