The GitHub Actions job "Tests (AMD)" on airflow.git/2605/ti_heartbeat_async has 
failed.
Run started by GitHub user Dev-iL (triggered by Dev-iL).

Head commit for run:
ad09f2d4b34964b3c434d0d2bea93ec1ec137d61 / Dev-iL 
<[email protected]>
Use async DB session for Execution API task-instance heartbeat

Convert ti_heartbeat from the synchronous SessionDep to the async 
AsyncSessionDep, adopting the async metadata engine that already ships in 
Airflow 3.x. The route's behavior is unchanged: same 204/404/409/410 responses, 
same fast-path UPDATE / SELECT ... FOR UPDATE fallback, same last_heartbeat_at 
semantics, no version bump.

Make AsyncSessionDep function-scoped so the async session commits before the 
response is sent, matching the synchronous SessionDep. FastAPI's default 
"request" scope for yield-dependencies commits after the response is sent, so a 
failed commit would roll back after the worker already received a 204 success. 
A regression test forces a commit failure and asserts the route surfaces an 
error rather than a silent 204.

Heartbeat's async writes exposed a test-harness issue on Postgres: the async 
engine binds its connection pool to the event loop that created it, while the 
test harness builds a fresh app and loop per test, so a pooled connection from 
a prior test's closed loop was reused. Add a reconfigure_async_db_engine 
autouse fixture to the heartbeat tests that rebuilds the async session per 
test, mirroring the existing workaround in TestWaitDagRun.

Document the asyncpg + transaction-mode pgbouncer prepared-statement caveat in 
the sql_alchemy_connect_args_async config reference and the PGBouncer setup 
guide (set statement_cache_size=0 and prepared_statement_cache_size=0); 
switching the default async driver to psycopg3 is tracked separately.

Report URL: https://github.com/apache/airflow/actions/runs/27093287733

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to