Repository navigation
Description
Environment
- firebase-tools: 15.9.1 (repo-pinned devDependency, run from
node_modules/.bin/firebase) - Platform: macOS 15 (Apple Silicon), self-hosted GitHub Actions runners
- Project: multi-codebase functions — one nodejs codebase + two Python codebases (
firebase-functionsPython SDK) - Command:
firebase deploy --only functions --force --project <id>in CI, with a job-level 60-minute timeout
Problem
When a firebase deploy run is killed externally mid-flight (CI job cancellation or timeout), the Python discovery admin server the CLI spawned (firebase_functions/private/serving.py, launched with ADMIN_PORT=<port>) is left running. The orphan keeps its admin port bound but eventually stops accepting connections.
Once one or more such orphans exist on the host, subsequent deploys hang indefinitely during "Loading and analyzing source code for codebase <python-codebase>": every localhost call to the admin port — including /__/quitquitquit — fails with connect ETIMEDOUT 127.0.0.1:<port> (timeout, not refused: a bound-but-not-accepting listener), and the CLI never errors out. In our CI this meant each affected deploy ran until the 60-minute job timeout killed it — which orphaned its discovery server too. Over 5 days ~35 orphaned serving.py processes accumulated on one runner host, at which point every deploy landing on it hung.
Debug log excerpt from a hung deploy (nodejs codebase discovery succeeded in ~1s just before this):
[debug] Running admin server with args: ["python3.12","<venv>/site-packages/firebase_functions/private/serving.py"] and env: {..., "ADMIN_PORT":"8120"} in <project>/firebase/functions/python-ytmusicapi
[info] * Serving Flask app 'serving'
[debug] Failed to call quitquitquit. This often means the server failed to start request to http://127.0.0.1:8120/__/quitquitquit failed, reason: connect ETIMEDOUT 127.0.0.1:8120
[error] * Running on http://127.0.0.1:8120
(no further log lines; the process sat there until the CI job timeout ~59 minutes later)
Verification
Killing the orphans (pkill -f "firebase_functions/private/serving.py" as the runner user) immediately restored ~2-minute deploys on the same host — reproduced across two hung runs and one clean rerun.
Expected behavior
- The CLI should hard-kill the discovery child process (SIGKILL by pid / process group) when
/__/quitquitquitis unreachable, and on its own exit paths — an HTTP-only shutdown can never clean up a wedged server. - Discovery should fail fast with a clear error when the admin port cannot be reached within a bounded time, instead of hanging the whole deploy indefinitely.
Workaround
A CI step before firebase deploy that pkills stale serving.py processes.
Activity
IzaakGough commentedon Jul 28, 2026
Hi @sallyjones6, thanks for raising this! We will investigate and get back to you as soon as possible.
IzaakGough commentedon Jul 29, 2026
I managed to reproduce this. This issue seems to be three bugs stacking up:
Minimal repro of the first point, no Firebase needed:
Prints still running: true. Delete the clearTimeout line and it gets killed as expected.
A fix for this needs to address all three of these points. I will follow up with a PR and keep you updated.
fix(functions): don't orphan the Python discovery server (#10893)