SendGrid · sdk · fg-0417

sendgrid-python send() hangs forever when the SendGrid API stalls

Worker or request thread stuck inside sg.send(message)

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

SendGridAPIClient.send takes no timeout and the underlying urllib call defaults to none, so a stalled connection blocks indefinitely. The lower-level client does accept a per-call timeout.

Fix

Call the lower-level client with an explicit timeout instead of send().

Apply

sg.client.mail.send.post(request_body=message.get(), timeout=10)

Affects: sendgrid (Python) 6.x through 6.12.5, issue open since 2021

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp