You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
start() holds the sync engines lock while CKSyncEngine decodes its saved state #577
As mentioned in #568: start() creates both CKSyncEngines inside syncEngines.withValue (SyncEngine.swift#L456-L466), so decoding a large state serialization holds the lock that isRunning (#L449) and the willResignActive handler (#L290) also take. With a 15 MB state I measured 12 to 14 second hangs on the main thread while the decode ran in the background.
I work around it by clearing the state once it passes 5 MB, which can drop unsent changes. Could the engines be created before taking the lock?
Activity