Skip to content

Language SDK task state writes skip the max_value_storage_bytes warning #74944

Closed

Description

@ChickenBenny

Description

[state_store] max_value_storage_bytes caps the size of a task state value. The public REST API rejects an oversized value with a 422, and a Python task logs a warning and still writes the value (task-sdk/src/airflow/sdk/execution_time/context.py), so a running task is never failed over the size.

Tasks run by the Go, TypeScript and Java SDKs get neither, because:

  • the coordinator does not pass max_value_storage_bytes to the language SDK
    runtime (_build_runtime_env() in
    task-sdk/src/airflow/sdk/coordinators/_subprocess.py passes only
    default_retention_days from [state_store]), and
  • neither the supervisor nor the Execution API checks the size on the write path.

Proposed change:

  1. Have the coordinator pass the setting as AIRFLOW__STATE_STORE__MAX_VALUE_STORAGE_BYTES, as it already does for
    AIRFLOW__STATE_STORE__DEFAULT_RETENTION_DAYS.
  2. In each SDK's task state Set, measure the value the way Python does (len(json.dumps(value)), which is also the length of the string the Execution API stores) and log a warning when it is over a positive limit. The write still proceeds.
  3. When the variable is not set, skip the check rather than fail the write. This covers an older coordinator that does not pass it.

Use case/motivation

An operator sets max_value_storage_bytes to steer task state toward small coordination values. A Python task that writes more gets a warning in its log; a Go, TypeScript or Java task writing the same value gets nothing. On Postgres and SQLite the value column has no practical size limit, so the value is stored without anyone noticing. On MySQL (MEDIUMTEXT) the write fails at around 16 MB.

Related issues

Each SDK already has a TODO for this, added during review of the task state store PRs: Go in #73420, Java in #73464 and TypeScript in #73618. #74400 tracks a related language SDK state store gap ([workers] state_store_backend).

I have the coordinator and Go SDK change ready; TypeScript and Java would follow in separate PRs.

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. boring-cyborg commented on Oct 18, 2026

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  2. jroachgolf84 commented on Oct 19, 2026

    @jroachgolf84
    Collaborator
  3. jason810496 commented on Oct 19, 2026

    @jason810496
    Member

    Just looked into it, thanks for the reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions