[0.83] Pick WebSocket queue size fix for Android inspector#56807
Open
huntie wants to merge 3 commits into
Open
[0.83] Pick WebSocket queue size fix for Android inspector#56807huntie wants to merge 3 commits into
huntie wants to merge 3 commits into
Conversation
Summary: Pull Request resolved: facebook#54300 Establishes a queue mechanism on top of the OkHttp's WebSocket implementation. This mechanism will control the queue size and guarantee that we don't have more than 16MB scheduled. This prevents the scenario of when OkHttp forces WS disconnection because of this threshold. Reviewed By: motiz88, alanleedev Differential Revision: D85581509 fbshipit-source-id: ac3e830c935c1301b674739c96fcbe18446eaa71
Summary: Pull Request resolved: facebook#54301 # Changelog: [Internal] Previously, we would read every single kilobyte and do Java -> C++ call with `jni`. For big objects, like source maps, this means that we were doing at least 1024 calls for a single megabyte of incoming data. From my observations, some source maps on Twilight could reach 30Mb+. There is a trade-off between how much of memory we want to allocate while reading a stream and a runtime. I didn't notice any differences while changing the chunk size from 8Kb to 1Mb and some values in between; in the end it purely depends on the OkHttp's or Okio's implementation of the stream, looks like it uses 8Kb as a chunk size by default: {F1983042734} Reviewed By: huntie Differential Revision: D85652217 fbshipit-source-id: 68474f0b7eece13a0a1c8ea9e617b99a26d81ff9
Summary: Pull Request resolved: facebook#54352 # Changelog: [Internal] Since we can now avoid disconnections, it should be safe to increase the chunk size. This should improve the trace loading time. Reviewed By: huntie Differential Revision: D85937959 fbshipit-source-id: 4f0ef023a4d756217de0c756dbc1decbd99698d4
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
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
Picks #54300 (+ follow-ups) to 0.83-stable.
Establishes a queue mechanism on top of OkHttp's WebSocket implementation for the Android inspector packager connection. This controls the queue size and guarantees that no more than 16 MiB is scheduled at once, preventing OkHttp from force-closing the WebSocket connection when the threshold is exceeded.
Changelog:
[Android] [Fixed] - Limit WebSocket queue size for packager connection
Test plan
CxxInspectorPackagerConnectionTest.kt.