volkanncicek opened a new issue, #77647:
URL: https://github.com/apache/airflow/issues/77647
### Under which category would you file this issue?
Airflow Core
### Apache Airflow version
3.4.0
### What happened and how to reproduce it?
On Python 3.14 the LocalExecutor stopped starting tasks after someone logged
in as the scheduler's service user over SSH and logged out again. Tasks stayed
in `queued`, and the scheduler log showed this for every attempt:
```
File ".../lib/python3.14/multiprocessing/forkserver.py", line 353, in main
File ".../lib/python3.14/multiprocessing/forkserver.py", line 393, in
_serve_one
self = reduction.pickle.load(from_parent)
FileNotFoundError: [Errno 2] No such file or directory
```
Python 3.14 uses `forkserver` by default on Linux. With `forkserver`,
multiprocessing semaphores keep their name in `/dev/shm` so the child can
reopen them (only the `fork` context unlinks them right away, see
`Lib/multiprocessing/synchronize.py`). systemd-logind's `RemoveIPC=yes`, which
is the default on Ubuntu, removes all POSIX IPC objects of a non-system user
when that user's last session ends. So the executor's semaphores disappear and
the forkserver can no longer start a worker.
1. Ubuntu 24.04, systemd 255 with default `RemoveIPC`, Python 3.14.10,
Airflow 3.4.0 in a virtualenv, LocalExecutor, `[core] mp_start_method` not set.
2. Service user created as a regular user (`useradd -m airflow`, UID 1001),
scheduler run by a systemd unit with `User=airflow`.
3. After the scheduler starts, `ls -la /dev/shm` shows a few `sem.mp-*`
files owned by `airflow`.
4. `ssh airflow@host true`. About 10 seconds later `[email protected]` stops
and `/dev/shm` is empty.
5. Trigger any DAG. The task stays `queued` and the traceback above is
logged.
Setting `[core] mp_start_method = fork` fixes it.
### What you think should happen instead?
Tasks should keep running. At minimum the `mp_start_method` docs could
mention this case, i.e. under systemd with `RemoveIPC=yes` and a non-system
service user, `forkserver`/`spawn` lose their semaphores on logout, so use
`fork`, run Airflow as a system user, or set `RemoveIPC=no`. A warning at
startup when this combination is detected would also help.
### Operating System
Ubuntu 24.04.5 LTS
### Deployment
Virtualenv installation
### Deployment details
systemd units for scheduler, dag-processor and api-server, running as the
`airflow` user. Python from `uv python install`.
### Anything else?
Same logind behaviour is documented for PostgreSQL:
https://www.postgresql.org/docs/current/kernel-resources.html (systemd
RemoveIPC). A similar report with `spawn` on 3.12:
https://github.com/spark-arena/sparkrun/issues/285
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]