Give devsupport networking its own dispatcher and pool (#58094) - #58094
Open
javache wants to merge 1 commit into
Open
Give devsupport networking its own dispatcher and pool (#58094)#58094javache wants to merge 1 commit into
javache wants to merge 1 commit into
Conversation
|
@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117196401. |
cortinico
approved these changes
Aug 24, 2026
cortinico
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary: `DevSupportHttpClient` derived its clients from the app's shared `OkHttpClient` with `newBuilder()`, which shares the underlying `Dispatcher` and `ConnectionPool`. Dev support keeps several long-lived WebSockets open to the dev server — the packager connection and the inspector among them — and a WebSocket occupies a running-call slot for its entire lifetime, because `RealWebSocket.loopReader` runs inside `RealCall.AsyncCall.execute`. OkHttp allows five concurrent calls per host by default, so those sockets throttle, and eventually stall, every other request to the dev server: `BundleDownloader` fetching the bundle itself, `PackagerStatusCheck`, and any application request that happens to target the same host. Give the devsupport clients a `Dispatcher` and a `ConnectionPool` of their own, still configured from the shared client so an `OkHttpClientFactory` override continues to apply. The per-host limit is raised on that dispatcher as well — without it the WebSockets would simply starve bundle traffic on the new dispatcher instead of the app's. Changelog: [Android][Fixed] - Stop dev server WebSockets from throttling bundle downloads and other dev server requests Reviewed By: cortinico Differential Revision: D117196401
javache
force-pushed
the
export-D117196401
branch
from
August 24, 2026 15:36
897b910 to
eca0577
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
DevSupportHttpClientderived its clients from the app's sharedOkHttpClientwithnewBuilder(), which shares the underlyingDispatcherandConnectionPool.Dev support keeps several long-lived WebSockets open to the dev server — the packager connection and the inspector among them — and a WebSocket occupies a running-call slot for its entire lifetime, because
RealWebSocket.loopReaderruns insideRealCall.AsyncCall.execute. OkHttp allows five concurrent calls per host by default, so those sockets throttle, and eventually stall, every other request to the dev server:BundleDownloaderfetching the bundle itself,PackagerStatusCheck, and any application request that happens to target the same host.Give the devsupport clients a
Dispatcherand aConnectionPoolof their own, still configured from the shared client so anOkHttpClientFactoryoverride continues to apply. The per-host limit is raised on that dispatcher as well — without it the WebSockets would simply starve bundle traffic on the new dispatcher instead of the app's.Changelog:
[Android][Fixed] - Stop dev server WebSockets from throttling bundle downloads and other dev server requests
Reviewed By: cortinico
Differential Revision: D117196401