hussein-awala opened a new pull request, #76211:
URL: https://github.com/apache/airflow/pull/76211

   `[triggerer] triggerer_health_check_threshold` is declared as a `float` in 
the [config 
schema](https://github.com/apache/airflow/blob/b95498cd56/airflow-core/src/airflow/config_templates/config.yml#L3135-L3144),
 and the health check behind `/health` and `airflow jobs check` [reads it with 
`getfloat`](https://github.com/apache/airflow/blob/b95498cd56/airflow-core/src/airflow/jobs/job.py#L70-L82).
 `TriggerRunnerSupervisor` reads the same option with `getint` in its class 
body, so a schema-valid value such as `30.5` raises `AirflowConfigException` as 
soon as `airflow.jobs.triggerer_job_runner` is imported. The triggerer cannot 
start, and the API server cannot build its core API either, because the public 
monitor routes import that module through `airflow.api.common.airflow_health`. 
Read the option with `getfloat`, as the health check and the neighbouring 
`runner_health_check_threshold` already do.
   
   related: #76209
   
   Whole-number values, including the default `"30"`, give the same window as 
before; the attribute is now `30.0` instead of `30`. It is only passed to 
`Trigger.assign_unassigned`, which builds a `timedelta(seconds=...)` from it to 
decide which triggerers are alive and whose triggers to take over, so a float 
works there unchanged. Fractional values now take effect instead of blocking 
startup, and the triggerer's reassignment window matches the one the health 
check uses. There is no new config option, default change, migration or API 
change. `v3-4-test` reads the option with the same `getint`, so the fix can be 
backported.
   
   With `AIRFLOW__TRIGGERER__TRIGGERER_HEALTH_CHECK_THRESHOLD=30.5`, checked by 
importing each module before and after the change, and by the regression test 
below:
   
   | Module | Before | After |
   |---|---|---|
   | `airflow.jobs.triggerer_job_runner` | `AirflowConfigException` at import | 
imports; the supervisor threshold is `30.5` |
   | `airflow.api_fastapi.core_api.routes.public` | same error at import | 
imports |
   
   A regression test executes a fresh copy of the triggerer module with the 
option set to `30.5`, because the value is read when the class is defined, and 
checks the supervisor's threshold. It fails with the config error without the 
change. It uses a separate module copy rather than `importlib.reload()`, so the 
classes that the rest of the test module imports and mocks are not rebound.
   
   Validation:
   
   - Focused triggerer tests: 206 passed, 1 skipped on SQLite.
   - PostgreSQL and MySQL were not run locally; this change has no database 
code.
   - Regular and manual static checks passed on the full diff.
   - Selected core suites and the documentation build were not run locally; CI 
validation is pending.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to