Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
- Support objectOverrides using `.spec.objectOverrides`.
See [objectOverrides concepts page](https://docs.stackable.tech/home/nightly/concepts/overrides/#object-overrides) for details ([#726]).

### Fixed

- Default `API_WORKERS` to 1 (instead of letting Airflow default to 4) to prevent crashloop and update/correct docs to reflect this ([#727]).

[#726]: https://github.com/stackabletech/airflow-operator/pull/726
[#727]: https://github.com/stackabletech/airflow-operator/pull/727

## [25.11.0] - 2025-11-07

Expand Down
6 changes: 3 additions & 3 deletions docs/modules/airflow/pages/troubleshooting/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ See e.g. https://github.com/minio/minio/issues/20845[this MinIO issue] for detai
== Setting API Workers

In Airflow the webserver (called the API Server in Airflow 3.x+) can use multiple workers.
This is determined by the environment variable `+AIRFLOW__API__WORKERS+` and is set by default to `4`.
For most cases the default should work without problem, but if you run into performance issues and would like to add more workers, you can either modulate multiple worker processes at the level of webserver, keeping the default value for each one:
This is determined by the environment variable `+AIRFLOW__API__WORKERS+` and is set by default to `1`.
For most cases this should work without problem, but if you run into performance issues and would like to add more workers, you can either modulate multiple worker processes at the level of webserver (keeping the default value for each instance):

[source,yaml]
----
Expand All @@ -46,7 +46,7 @@ or change the environment variable using `envOverrides`:
----
webservers:
envOverrides:
AIRFLOW__API__WORKERS: "6" # something other than the default
AIRFLOW__API__WORKERS: "4" # something other than the default
----

TIP: Our strong recommendation is to increase the webserver replicas, with each webserver running a single worker, as this removes the risk of running into timeouts or memory issues.
Expand Down
12 changes: 12 additions & 0 deletions rust/operator-binary/src/env_vars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,18 @@ fn add_version_specific_env_vars(
JWT_SECRET_SECRET_KEY,
),
);
// The Airflow default for this is 4.
// However, with the default resources this could cause problems,
// as the Pod went to 100% CPU usage and didn't get healthy
// quick enough, resulting in a crashloop.
env.insert(
"AIRFLOW__API__WORKERS".into(),
EnvVar {
name: "AIRFLOW__API__WORKERS".into(),
value: Some("1".into()),
..Default::default()
},
);
if airflow_role == &AirflowRole::Webserver {
// Sometimes a race condition can arise when both scheduler and
// api-server are updating the DB, which adds overhead (conflicts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ spec:
max: 2000m
memory:
limit: 3Gi
envOverrides:
# logging tests use two webservers and if two tests should run in
# parallel then the CPU usage can be high if the default number of
# workers (4) is used
AIRFLOW__API__WORKERS: "1"
roleGroups:
automatic-log-config:
replicas: 1
Expand Down