- Symptom
- Worker or request thread stuck inside sg.send(message)No exception and no response during a network blipBatch jobs stop partway with no error logged
- 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)- Affected
- sendgrid (Python) 6.x through 6.12.5, issue open since 2021
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders