bito-code-review[bot] commented on code in PR #44581:
URL: https://github.com/apache/superset/pull/44581#discussion_r4152368622
##########
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:
<!-- Bito Reply -->
The suggestion provided by the reviewer is valid and addresses a potential
performance bottleneck by highlighting the risk of thread contention when
multiple API-key lookups share a single-threaded executor. The implementation
described in the user's reply, which uses a budgeted metadata connection pool
to manage these lookups, effectively mitigates the risk of serialization and
blocking identified in the review.
**superset/mcp_service/composite_token_verifier.py**
```
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(
transport_executor(self._app),
self._validate_api_key_sync, token
```
--
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]