Skip to content
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

Thread waiting on a lower QoS thread #12527

Closed
data-sync-user opened this issue Nov 28, 2022 · 4 comments
Closed

Thread waiting on a lower QoS thread #12527

data-sync-user opened this issue Nov 28, 2022 · 4 comments

Comments

@data-sync-user
Copy link
Collaborator

Thread Performance Checker: Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 38362, TID: 209725
Backtrace
=================================================================
4   Shared                              0x000000010c645434 $s6Shared8DeferredC5valuexvg + 660
5   Sync                                0x000000010b93948f $s7Storage10RustPlacesC24migrateBookmarksIfNeeded13fromBrowserDByAA0iJ0C_tF + 703
6   Client                              0x00000001081e55ac $s6Client14BrowserProfileC6reopenyyF + 460
7   Client                              0x000000010820a5f1 $s6Client14BrowserProfileCAA0C0A2aDP6reopenyyFTW + 17
8   Client                              0x0000000108055352 $s6Client11AppDelegateC26applicationDidBecomeActiveyySo13UIApplicationCF + 450
9   Client                              0x0000000108056c74 $s6Client11AppDelegateC19handleNotificationsyy10Foundation12NotificationVF + 436
10  Client                              0x0000000108056f1f $s6Client11AppDelegateC19handleNotificationsyy10Foundation12NotificationVFTo + 111
11  CoreFoundation                      0x00007ff80035869b __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 137
12  CoreFoundation                      0x00007ff8003585d1 ___CFXRegistrationPost_block_invoke + 86
13  CoreFoundation                      0x00007ff800357bb0 _CFXRegistrationPost + 541
14  CoreFoundation                      0x00007ff8003574b9 _CFXNotificationPost + 822
15  Foundation                          0x00007ff800c08501 -[NSNotificationCenter postNotificationName:object:userInfo:] + 82
16  UIKitCore                           0x000000010f5bcfba -[UIApplication _stopDeactivatingForReason:] + 1472
17  UIKitCore                           0x000000010e9f9620 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 333
18  UIKitCore                           0x000000010e9f99c8 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 831
19  UIKitCore                           0x000000010e9f9275 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 354
20  UIKitCore                           0x000000010ea080e1 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 178
21  UIKitCore                           0x000000010ef3c363 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 833
22  UIKitCore                           0x000000010f08942f _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 257
23  UIKitCore                           0x000000010ea07d61 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 348
24  UIKitCore                           0x000000010e7eaf16 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.594 + 815
25  UIKitCore                           0x000000010e7e992c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 245
26  UIKitCore                           0x000000010e7eaac3 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 255
27  UIKitCore                           0x000000010ef6f0c6 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 475
28  FrontBoardServices                  0x00007ff80547cd94 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 521
29  FrontBoardServices                  0x00007ff8054ac45a __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 133
30  FrontBoardServices                  0x00007ff80548a46a -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 209
31  FrontBoardServices                  0x00007ff8054ac3a2 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 372
32  libdispatch.dylib                   0x000000010aaebf5b _dispatch_client_callout + 8
33  libdispatch.dylib                   0x000000010aaef8d2 _dispatch_block_invoke_direct + 496
34  FrontBoardServices                  0x00007ff8054d0980 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
35  FrontBoardServices                  0x00007ff8054d0876 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 174
36  FrontBoardServices                  0x00007ff8054d09a8 -[FBSSerialQueue _performNextFromRunLoopSource] + 19
37  CoreFoundation                      0x00007ff800387035 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
38  CoreFoundation                      0x00007ff800386f74 __CFRunLoopDoSource0 + 157
39  CoreFoundation                      0x00007ff800386771 __CFRunLoopDoSources0 + 212
40  CoreFoundation                      0x00007ff800380e73 __CFRunLoopRun + 927
41  CoreFoundation                      0x00007ff8003806f7 CFRunLoopRunSpecific + 560
42  GraphicsServices                    0x00007ff809c5c28a GSEventRunModal + 139
43  UIKitCore                           0x000000010f5c262b -[UIApplication _run] + 994
44  UIKitCore                           0x000000010f5c7547 UIApplicationMain + 123
45  Client                              0x0000000108331602 main + 930

!Screen Shot 2022-11-28 at 11.38.34 AM.png|width=1948,height=406!

┆Issue is synchronized with this Jira Task

@data-sync-user
Copy link
Collaborator Author

➤ Laurie Marceau commented:

Happened with this stacktrace too

hread Performance Checker: Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 95025, TID: 7203141
Backtrace

3 Client 0x00000001051b37b4 -[GCDWebServer stop] + 392
4 Client 0x00000001051b3e54 -[GCDWebServer stop] + 224
5 Client 0x0000000104d20328 $s6Client11AppDelegateC29applicationDidEnterBackgroundyySo13UIApplicationCFyycfU
+ 112
6 Client 0x0000000104905054 $sIeg_IeyB_TR + 48
7 libdispatch.dylib 0x000000010763e05c _dispatch_client_callout + 20
8 libdispatch.dylib 0x00000001076411e8 _dispatch_continuation_pop + 792
9 libdispatch.dylib 0x0000000107657ed0 _dispatch_source_invoke + 1668
10 libdispatch.dylib 0x000000010764e670 _dispatch_main_queue_drain + 780
11 libdispatch.dylib 0x000000010764e354 _dispatch_main_queue_callback_4CF + 44
12 CoreFoundation 0x000000018f4066f8 5CDC5D9A-E506-3740-B64E-BB30867B4F1B + 632568
13 CoreFoundation 0x000000018f3e8058 5CDC5D9A-E506-3740-B64E-BB30867B4F1B + 507992
14 CoreFoundation 0x000000018f3eced4 CFRunLoopRunSpecific + 612
15 GraphicsServices 0x00000001c86ee368 GSEventRunModal + 164
16 UIKitCore 0x00000001918cb3d0 179501B6-0FC2-344A-B969-B4E3961EBE10 + 3810256
17 UIKitCore 0x00000001918cb034 UIApplicationMain + 340
18 Client 0x0000000104fe4d90 main + 864
19 dyld 0x00000001ada54960 CB3FF411-4762-34D2-86A4-ECA13F9FB6C3 + 88416

@tarikeshaq
Copy link
Contributor

5 Sync 0x000000010b93948f $s7Storage10RustPlacesC24migrateBookmarksIfNeeded13fromBrowserDByAA0iJ0C_tF + 703

We can safely remove the old migrateBookmarksIfNeededFromBrowserDB. it's very old and I have reason to believe it was very broken anyways. Looks like it was removed in the past, but was restored in https://github.com/mozilla-mobile/firefox-ios/pull/6393/files because it broke tests. I'll try a PR removing it to see if tests fail. Otherwise we should probably mark it so it only runs in tests.

@data-sync-user
Copy link
Collaborator Author

➤ Orla Mitchell commented:

For QA please verify there are no new visible performance regressions, such as slow downs or hangs during regular use.

@data-sync-user
Copy link
Collaborator Author

➤ Andrei Bodea commented:

Verified as fixed on v117 (33169) with iPhone 13 Pro (15.7.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants