hkc-8010 commented on PR #66854:
URL: https://github.com/apache/airflow/pull/66854#issuecomment-4488629081

   ### Code review
   
   Found 1 issue:
   
   1. `session.commit()` is called inside `ti_update_state`, which receives a 
`session` parameter. The project's 
[CLAUDE.md](https://github.com/hkc-8010/my-airflow-repository/blob/c8086d27f64146cf47931ed28b8aff8d463ecb93/CLAUDE.md#L135-L137)
 says "In \`airflow-core\`, functions with a \`session\` parameter must not 
call \`session.commit()\`." The caller is meant to own the transaction 
boundary; committing inside a session-accepting function makes the transaction 
lifecycle implicit and harder to reason about for callers and subclasses.
   
   
https://github.com/hkc-8010/my-airflow-repository/blob/c8086d27f64146cf47931ed28b8aff8d463ecb93/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py#L459-L467
   
   🤖 Generated with [Claude Code](https://claude.ai/code)
   
   <sub>- If this code review was useful, please react with 👍. Otherwise, react 
with 👎.</sub>


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