react-native
react-native copied to clipboard
Xcode 14.0 beta 4 reports "Hang Risk" in RCTWebSocket
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
- Create react-native project on Xcode Version 14.0 beta 4 (14A5284g)
- Run application
Snack, code example, screenshot, or link to a repository
https://github.com/facebook/react-native/blob/6fcfe2e1b35e9bdf319bcdc1647c8c0d997b58c7/Libraries/WebSocket/RCTSRWebSocket.m#L1636
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 Any alternate fix to at least patch this issue until we wait for a permanent fix?
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: https://github.com/realm/realm-core/issues/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 https://github.com/realm/realm-core/issues/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 at:
- (NSRunLoop *)runLoop
{
dispatch_group_wait(_waitGroup, DISPATCH_TIME_FOREVER);
return _runLoop;
}
+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 Need to move to the other view and back to refresh my app
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 +1
comment if you have the same problem or interest this post.
having exactly the same issue. Any updates?
this just popped to me today after running a pod install
this worked for me as temp measure
described here https://developer.apple.com/documentation/xcode/diagnosing-performance-issues-early
this worked for me
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 Is anyone actually experiencing any problems from this? Could it be a pre-existing non-issue that XCode just started complaining about?
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 dispatch_group_wait
-- it's a primitive that doesn't provide priority inversion avoidance.The link (https://developer.apple.com/documentation/xcode/diagnosing-performance-issues-early) explains how these inversions should be addressed.
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: OS: macOS 12.5.1 CPU: (10) arm64 Apple M1 Max Memory: 3.67 GB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 19.2.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 9.2.0 - /opt/homebrew/bin/npm Watchman: 2022.12.05.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: Not Found SDKs: iOS SDK: Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.1/14B47b - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.6 => 0.70.6 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
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 : 1) I cleaned the build folder from XCODE (Product > Clean Build Folder) 2) I removed the DerivedData folder in ~/Library/Developer/Xcode/DerivedData 3) I restarted my computer
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: OS: macOS 12.6 Monterey CPU: 1.8 GHz Intel Core i5 Memory: 8 GB 1600 Mhz DDR3 Node : v16.17.1 Xcode: 14.0.1 React: 18.1.0 React-native: 0.70.6
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 : 1) I cleaned the build folder from XCODE (Product > Clean Build Folder) 2) I removed the DerivedData folder in ~/Library/Developer/Xcode/DerivedData 3) I restarted my computer
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: OS: macOS 12.6 Monterey CPU: 1.8 GHz Intel Core i5 Memory: 8 GB 1600 Mhz DDR3 Node : v16.17.1 Xcode: 14.0.1 React: 18.1.0 React-native: 0.70.6
Thank you! It works for me!
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 : 1) I cleaned the build folder from XCODE (Product > Clean Build Folder) 2) I removed the DerivedData folder in ~/Library/Developer/Xcode/DerivedData 3) I restarted my computer
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: OS: macOS 12.6 Monterey CPU: 1.8 GHz Intel Core i5 Memory: 8 GB 1600 Mhz DDR3 Node : v16.17.1 Xcode: 14.0.1 React: 18.1.0 React-native: 0.70.6
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邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。