kaxil commented on code in PR #76416:
URL: https://github.com/apache/airflow/pull/76416#discussion_r4467302261


##########
airflow-core/src/airflow/api_fastapi/logging/decorators.py:
##########
@@ -357,6 +363,6 @@ async def log_action(
         session.add(log)
         # Explicit commit to persist the access log independently if the path 
operation fails or not.
         # Also it cannot be deferred to a 'function' scoped dependency because 
of the `request` parameter.
-        session.commit()
+        await session.commit()

Review Comment:
   This commit now goes through the async engine, and 
`_configure_async_session` never registers the MySQL `SET time_zone = '+00:00'` 
listener from `setup_event_handlers`, which only runs on the sync engine. 
`UtcDateTime` sends MySQL a naive UTC value, so on a MySQL server whose time 
zone isn't UTC every audit row the API server writes would get `dttm` (and 
`logical_date`) shifted by the server offset, while rows from the scheduler and 
CLI stay correct. Could `_configure_async_session` register the same listener 
on `async_engine.sync_engine` (or set it via the async connect args)? The 
heartbeat route already writes `last_heartbeat_at` through this engine, so a 
fix there covers both before the `v3-4-test` backport ships.



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