-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcode 14.0 beta 4 reports "Hang Risk" in RCTWebSocket #34400
Comments
Any movement on this? Our app is similarly hamstrung after upgrade to iOS16 |
Facing the same issue on iOS 15.x and iOS 16 on Xcode 14.0.1 |
Try clone the new repo for your project! |
Facing the same issue on iOS 15.x and iOS 16 on Xcode 14.0.1. I think there is something wrong with the generated FBReactNativeSpec code. |
This falls under the same category as discussed here: realm/realm-core#5697 The difference is that this inversion is triggered by a dispatch group but it's the same problem -- the threads in the dispatch group are not running at a QoS higher than "Default". For folks who work on Websocket, there are resolution strategies mentioned in realm/realm-core#5697. |
any updates on this? |
Any updates on this issue, I can reproduce this bug on Fresh react native 0.70.2. |
the same error |
same error |
node_modules/react-native/Libraries/WebSocket/RCTSRWebSocket.m:1632: warning run: Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
|
+1 |
+1 This seems present on a Fresh RN upgrade |
+1 I cannot connect to the Web Socket in the useEffect() triggered by App State after returning from background state Xcode 14.0.1 |
+1 who can help to fix this issue? |
same error |
+1 |
is there any solution? |
Hey guys. Please upvote to the original post instead of adding a |
having exactly the same issue. Any updates? |
this just popped to me today after running a pod install |
described here https://developer.apple.com/documentation/xcode/diagnosing-performance-issues-early |
You just turned off the checker, that doesn't mean the underlying issue is solved. |
I got this too. XCode 14.1. RN 0.69.5 |
I don't work on React but as I mentioned in my comment above, this issue is pointing to a priority inversion. Priority inversions won't crash your program but can cause performance issues especially when system is under heavy resource contention. This inversion is coming from the React framework itself. Folks who maintain the React framework should audit their usage of As for app developers who are seeing this (because they are using React), they should keep an eye on whether this inversion is causing hangs in their app for their app users. If it is, you probably want to deep dive more in the architecture of your app to avoid this inversion. |
I started having this issue out of the blue. Originally I think it came up when adding a new dependency (react-native-mixpanel) but now im having the issue on all my branches, even without that dep. |
I get this same error only when running to device. Not happening when building to an iPhone simulator. System: |
I had the same problem ( and I finally fixed it without really knowing why..., probably an indexing issue from XCODE 14). If may be it can help you, these are the steps I follow : After that, I opened my app workspace from XCODE, a file indexing process started and took a very long time (something like 15 or 20 minutes). Once indexing process finished, I tried to build again and VOILA, this time it worked ! I really hope it will help you. Regards, Jean-Baptiste My system: |
Thank you! |
Thanks @jbb-dev For those looking for the derivedData folder, from Xcode 6 you can find the path under ~/Users/YOUR_USERNAME/Library/Developer/Xcode/DerivedData Also you can go to Xcode's settings and on the locations tab you can see your derived data path. The folder is hidden, make sure to press Shift + Cmd + . to show the hidden folders. |
这是来自QQ邮箱的假期自动回复邮件。
您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
|
I tried this but it didn't work for me. |
这是来自QQ邮箱的假期自动回复邮件。
您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
|
Any progress or solution? My app with vlc player hangs constantly, but I cannot find why. |
same issue even on a fresh rn project without any code changes xcode 14.0.1 |
FWIW, elevating the thread priority suppresses the priority inversion warning: diff --git a/Libraries/WebSocket/RCTSRWebSocket.m b/Libraries/WebSocket/RCTSRWebSocket.m
index 925596f8677..a6244fb677e 100644
--- a/Libraries/WebSocket/RCTSRWebSocket.m
+++ b/Libraries/WebSocket/RCTSRWebSocket.m
@@ -1688,6 +1688,7 @@ static NSRunLoop *networkRunLoop = nil;
dispatch_once(&onceToken, ^{
networkThread = [_RCTSRRunLoopThread new];
networkThread.name = @"com.squareup.SocketRocket.NetworkThread";
+ networkThread.qualityOfService = NSQualityOfServiceUserInteractive;
[networkThread start];
networkRunLoop = networkThread.runLoop;
}); I have no idea whether this doesn't negatively affects anything else as I have no clue what it is used for. That said, it looks like this module has recently been replaced: #36471 |
Yep. If we wanted to apply this fix right now, the proper place would be in SocketRocket's SRRunLoopThread.m. |
// #import "SRRunLoopThread.h" @Property (nonatomic, strong, readwrite) NSRunLoop *runLoop; @implementation SRRunLoopThread
@EnD这个是我修改的关于SRRunLoopThread.m 的修复。 |
Although there are no warnings, as a rule of thumb, it is not appropriate to use the highest priority for both the network thread and the UI thread. |
SocketRocket 0.7.0 fixes this here. |
Note that there is a difference between the fix in this thread vs what SocketRocket 0.7.0 does; SocketRocket is using NSQualityOfServiceUserInitiated, the fix in this thread is using NSQualityOfServiceUserInteractive. |
I've seen this alternative PR to fix the issue, facebookincubator/SocketRocket#659, but not sure which is the best solution. I guess that whichever it is, we'd only be able to get it in a future version of react-native? Just for interest's sake, if this projected updated it's dependency from 0.61 (current) to 0.70 or 0.71, would this still be in a react-native patch release, or would we have to wait for 0.73? |
@cipolleschi
However, when I run the iOS app on Xcode, I get a memory warning message saying |
yes, we are considering it. We couldn't do it before due to transitive dependencies that would have make other libraries incompatible. |
Any plans for fixing this issue with upcoming releases? |
The commit to move SocketRocket to 0.7.0 (which resolves the issue) is already on main: bab9c83 but it doesn't look like it made it into 0.73.0 or 0.73.1 from what I can see in the release tags. You could request it to be picked to 0.73.2 here: reactwg/react-native-releases#95 |
Description
Error reported:
Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
.Using Xcode Version 14.0 beta 4 (14A5284g).
Seemingly originates from RCTSRWebSocket.m
Version
0.66.3
Output of
npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 12.5
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 186.13 MB / 16.00 GB
Shell: 5.8 - /usr/local/bin/zsh
Binaries:
Node: 14.17.1 - ~/.nvm/versions/node/v14.17.1/bin/node
Yarn: 1.22.10 - ~/src/github.com/umbermoney/daisy/node_modules/.bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /Users/lucas/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 21, 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-29 | Google APIs Intel x86 Atom, android-31 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.3/13E113 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_251 - /Users/lucas/.jenv/shims/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.3 => 0.66.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Snack, code example, screenshot, or link to a repository
react-native/Libraries/WebSocket/RCTSRWebSocket.m
Line 1636 in 6fcfe2e
The text was updated successfully, but these errors were encountered: