bito-code-review[bot] commented on code in PR #44581:
URL: https://github.com/apache/superset/pull/44581#discussion_r4152043716
##########
superset/mcp_service/composite_token_verifier.py:
##########
@@ -180,9 +180,13 @@ async def verify_token(self, token: str) -> AccessToken |
None:
"""
if any(token.startswith(prefix) for prefix in self._api_key_prefixes):
if self._app is not None:
+ from superset.mcp_service.worker import transport_executor
+
loop = asyncio.get_running_loop()
+ # Metadata I/O on the transport side shares a bounded,
+ # pool-budgeted executor with audit writes and RBAC filtering.
result = await loop.run_in_executor(
- None, self._validate_api_key_sync, token
+ transport_executor(self._app),
self._validate_api_key_sync, token
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Single-thread executor contention</b></div>
<div id="fix">
This routes FAB validation onto `transport_executor(self._app)`, whose pool
has a single thread (`TRANSPORT_METADATA_THREADS = 1`, worker.py:207). Every
API-key auth now shares that one thread with audit writes and RBAC filtering
(`run_in_metadata_thread` callers in middleware.py); a slow or timing-out FAB
DB call serializes all of them, and unauthenticated `sst_` requests can hold
the thread. Consider a larger or dedicated bound for auth validation.
</div>
</div>
<small><i>Code Review Run #b98e53</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]