Question
Why am I seeing IncompleteMessage errors and connection drops when using the Segment /v1/batch endpoint, especially with Rust reqwest and hyper clients in Windows environments?
Product
Twilio Segment
Environment
Segment Console
Answer
IncompleteMessage errors and connection drops can happen when the client’s HTTP connection pool idle timeout is longer than Segment’s Application Load Balancer (ALB) idle timeout of 60 seconds. If the ALB closes an idle connection while your client tries to reuse it, the response may be incomplete. This is more common in Windows desktop environments and with Rust reqwest/hyper clients.
To reduce these errors:
- Set your HTTP client’s pool idle timeout to less than 55 seconds (for example, 50 seconds).
- Enable automatic retry for connection errors.
- Check if local proxies or firewalls have shorter idle timeouts and adjust your client settings accordingly.
- For Rust reqwest/hyper clients, explicitly configure idle timeout and retry logic.
Additional Information
- Segment’s tracking-api server idle timeout is 70 seconds, so the ALB timeout triggers first.
- Review Segment’s batch API documentation for request and event size limits.