有时在iOS9中,请求最多延迟1分钟nsurlstoraged-NSURLStorageURLCacheDB deleteAllResponses数据库已锁定

埃桑查

自iOS 9以来,我们一直在处理应用程序处理请求的过程中重现这些巨大的延迟/应用程序可以正常启动,查看控制器并执行所有操作。我可以与该应用程序进行交互,但在某些情况下,它不会加载所有请求中的某些请求。它仅在iOS9设备中发生(无论它是针对iOS8还是iOS9构建的,都没有关系)。

我们唯一的线索是每次发生这种情况时都会重复记录:

Oct 2 15:21:15 Hurts-iPhone ondemandd[1364] <Error>: -[ODRBackgroundMaintenance startBackgroundMaintenanceOperations]
Oct 2 15:21:20 Hurts-iPhone nsurlstoraged[107] <Warning>: ERROR: NSURLStorageURLCacheDB deleteAllResponses: dbConnection=0x188dd200 DB=/private/var/mobile/Containers/Data/Application/5CD0BB06-3EF9-4A76-B5AF-25C86A8FA2AC/Library/Caches/com.company.bundleId/Cache.db Delete from cfurl_cache_blob_data failed:database is locked ErrCode: 5.
Oct 2 15:21:31 Hurts-iPhone nsurlstoraged[107] <Warning>: ERROR: NSURLStorageURLCacheDB deleteAllResponses: dbConnection=0x188dd200 DB=/private/var/mobile/Containers/Data/Application/5CD0BB06-3EF9-4A76-B5AF-25C86A8FA2AC/Library/Caches/com.company.bundleId/Cache.db Delete from cfurl_cache_receiver_data failed:database is locked ErrCode: 5.
Oct 2 15:21:31 Hurts-iPhone nsurlstoraged[107] <Error>: Error: execSQLStatement:onConnection:toCompletionWithRetry:writeLockHelp - SQL=COMMIT;, error-code=1, error-message=cannot commit - no transaction is active
Oct 2 15:21:31 Hurts-iPhone nsurlstoraged[107] <Warning>: ERROR: NSURLStorageURLCacheDB deleteAllResponses: dbConnection=0x188dd200 DB=/private/var/mobile/Containers/Data/Application/5CD0BB06-3EF9-4A76-B5AF-25C86A8FA2AC/Library/Caches/com.company.bundleId/Cache.db Commit transaction failed:cannot commit - no transaction is active ErrCode: 1.
Oct 2 15:21:34 Hurts-iPhone kernel[0] <Notice>: IOAccessoryManager::configureAllowedFeatures: tristar: revoking mask=0xffff
Oct 2 15:21:34 Hurts-iPhone iaptransportd[29] <Warning>: CIapPortAppleIDBus: Auth timer timeout completed on pAIDBPort:0x17d4a4e0, portID:01 downstream port
Oct 2 15:21:41 Hurts-iPhone nsurlstoraged[107] <Warning>: ERROR: NSURLStorageURLCacheDB deleteAllResponses: dbConnection=0x188dd200 DB=/private/var/mobile/Containers/Data/Application/5CD0BB06-3EF9-4A76-B5AF-25C86A8FA2AC/Library/Caches/com.company.bundleId/Cache.db Vacuum failed:database is locked ErrCode: 5

我所见过的唯一具有相同行为的情况是在Mac OS X中,并使用了本机应用程序(邮件,iTunes等),这使情况更加奇怪。

延迟请求似乎可以缓解这些情况。这绝对是iOS上的僵局,但我们很乐于助您一臂之力。

埃桑查

我终于找到了从一开始就从应用程序中删除缓存的解决方案。我们不大量使用应用程序缓存,因此,就我们而言,这并不是性能方面的昂贵解决方案。删除缓存的方法是在应用程序的开始处设置一个空的缓存

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:0
                                                     diskCapacity:0
                                                         diskPath:nil];
[NSURLCache setSharedURLCache:URLCache];

我希望这对其他人有帮助。

同时,Apple方面有一些未解决的错误报告。当我得到更多关于它的信息时,我会在这里发布它。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档