> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sifr.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# SIFR-ASYNC-0003: Blocking I/O function called directly from async context.

> Blocking I/O function called directly from async context.

`SIFR-ASYNC-0003` belongs to the **Async effect and awaitability** diagnostic family. It means: blocking I/O function called directly from async context.

## Why It Happens

Sifr tracks suspension and blocking effects statically. This diagnostic fires when async code either does not really suspend, awaits work that cannot suspend, or calls blocking/CPU-heavy work without an explicit offload boundary.

<Info>
  Use `sifr --explain SIFR-ASYNC-0003` locally to see the renderer's exact message template and any machine-applicable suggestions for the compiler version you are running.
</Info>

## Erroneous Code

```python theme={null}
from sifr.io import read_text

async def load() -> str:
    return read_text("config.txt")
```

## How To Fix It

Move blocking I/O behind a supported offload helper or call an async API instead of blocking the task directly.

## Fixed Code

```python theme={null}
from sifr.io import read_text

@blocking_io
def read_config() -> str:
    return read_text("config.txt")

async def load() -> str:
    return await task.spawn_blocking(read_config)
```

## Details

| Field                  | Value                                                                       |
| ---------------------- | --------------------------------------------------------------------------- |
| Code                   | `SIFR-ASYNC-0003`                                                           |
| Family                 | `ASYNC`                                                                     |
| Severity               | Error                                                                       |
| Stability              | stable                                                                      |
| Owner                  | `sifr_lowering::lower::workload_annotations`                                |
| Representative fixture | `crates/sifr/tests/e2e/fail/blocking_io_direct_call_in_async_rejected.sifr` |

See the [Error Codes index](/diagnostics/error-codes) for the complete catalog.
