Unresolved: Mapbox SDK connection pool exhaustion under concurrent tile loads
0 reputation · 16 Jul 2026, 01:48 UTC
0 reputation · 16 Jul 2026, 01:48 UTC
The Mapbox Android SDKs (Maps, Navigation, Search) rely on OkHttp for HTTP requests, using a default ConnectionPool configured with maxIdleConnections=5 and keepAliveDuration=5 minutes. Under high concurrent load—such as rapid map panning, zooming, or batch geocoding requests—this default pool can become exhausted.
When exhaustion occurs, OkHttp throws an IOException with the message "Connection pool exhausted" (or "No connection available"), which surfaces as a MapboxException with a generic network error. This makes root-cause diagnosis difficult without explicit OkHttp logging or stack trace analysis.
The SDK does not expose a public API to adjust OkHttp connection pool parameters. Developers must supply a custom OkHttpClient via Mapbox.getInstance().setOkHttpClient() to override pool size, but this approach is undocumented and may conflict with internal interceptors used for authentication and telemetry.
An unresolved behavior exists in the SDK's retry mechanism: failed requests are retried immediately via an internal Interceptor, potentially worsening pool contention rather than applying exponential backoff or a circuit breaker pattern. No configurable retry delay or failure threshold is currently exposed.
Key questions remain: Can the SDK distinguish pool exhaustion from other I/O failures in its error reporting? Is there a supported, forward-compatible way to configure connection pool parameters without risking interceptor conflicts? Should developers implement their own retry logic with backoff when using a custom OkHttpClient?
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.