jason810496 commented on code in PR #74364:
URL: https://github.com/apache/airflow/pull/74364#discussion_r4502062573
##########
airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:
##########
@@ -162,7 +163,9 @@ async def get_user_from_token(self, token: str) -> BaseUser:
log.error("JWT token is not valid: %s", e)
raise e
- if (jti := payload.get("jti")) and RevokedToken.is_revoked(jti):
+ # A synchronous DB round trip, on the event loop, on every
authenticated request;
+ # ``TeamAuthorizationMiddleware.dispatch`` offloads its auth manager
call the same way.
+ if (jti := payload.get("jti")) and await
run_in_threadpool(RevokedToken.is_revoked, jti):
Review Comment:
As mentioned in
https://github.com/apache/airflow/pull/76416#issuecomment-6625736262, we
shouldn't hide sync DB work behind an explicit threadpool offload.
Let's support the async method instead.
The https://github.com/apache/airflow/pull/76424 prevent exact the case this
PR introduce.
--
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]