Bug
Two async functions use the synchronous requests.post() from the requests library, which blocks the FastAPI async event loop during execution:
-
app/modules/auth/auth_router.py:56-59 — send_slack_message():
async def send_slack_message(message: str):
payload = {"text": message}
if SLACK_WEBHOOK_URL:
requests.post(SLACK_WEBHOOK_URL, json=payload) # blocks event loop
-
app/modules/utils/parse_webhook_helper.py:11-23 — send_slack_notification():
async def send_slack_notification(self, project_id, error_msg=None):
...
response = requests.post(self.url, ...) # blocks event loop
Neither call sets a timeout, so if Slack is unreachable the call can hang indefinitely.
Impact
When Slack is slow or unreachable, the synchronous HTTP call blocks the entire async event loop, stalling all concurrent requests until the call completes or the OS-level TCP timeout is reached.
Expected behavior
Async functions should use an async HTTP client (httpx.AsyncClient, which is already a project dependency) with a reasonable timeout.