Posts

Post not yet marked as solved
10 Replies
2.8k Views
Hi,I am having trouble using a background NSURLSession to upload ~300 files (2.4G). The upload works fine at first, but always ends up timing out with a nsurlsessond error -1001. Usually the timeout is 10-20 minutes into the upload (at about 1G, but never at the same point).The session is configured with timeoutIntervalForRequest set to 1 minute and timeoutIntervalForResource set to 24 hours. Everything else uses the default config. When the app kicks off an upload, each of the files to be uploaded creates its own upload task, which are all part of a single session. The session is created on init. Also note that for the purpose of this test, the entire transfer occured in the foreground despite using a background session.In the system logs I see some concerning log statements, but google is less than helpful at determining what they mean. Here are the concerning entries:Jun 19 14:24:02 Marine-iPad-Air-2 nsurlsessiond[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> resuming Jun 19 14:24:02 Marine-iPad-Air-2 nsurlsessiond[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> has not requested a begin delay Jun 19 14:24:02 Marine-iPad-Air-2 nsurlsessiond[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> skipping delayed request callback - delegate not implemented Jun 19 14:24:02 Marine-iPad-Air-2 nsurlsessiond[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> will begin Jun 19 14:24:03 Marine-iPad-Air-2 nsurlsessiond[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> for client _willSendRequestForEstablishedConnectionthis occurs for a bunch of tasks, not just 662. In my applcation logs (in my DidReceiveData delegate) I can see progress being made for some other tasks, but there is no mention of task 662 (or any of the others with similar logs) making progress. About a minute later, I get:Jun 19 14:25:03 Marine-iPad-Air-2 nsurlsessiond(CFNetwork)[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> finished with error - code: -1001 Jun 19 14:25:03 Marine-iPad-Air-2 nsurlsessiond[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> for client will be retried after error - code: -1001 Jun 19 14:25:03 Marine-iPad-Air-2 nsurlsessiond[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> logTaskError isDownload = N bytesReceived = 0 bytesSent = 0 isRecoverable = Y Jun 19 14:25:03 Marine-iPad-Air-2 nsurlsessiond[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> 2324.565926 seconds past start time, new delay: 0.000000, new window: 0.000000 Jun 19 14:25:03 Marine-iPad-Air-2 nsurlsessiond[812] : Task <29DE1E45-4844-4F79-B9B8-7E5C8265D955>.<662> will retry after 1024 secondTiming out after a minute makes sense, given the value of timeoutIntervalForRequest. My question is, why is everything fine early on, and then my tasks get these odd resume/begin messages? Why aren't they starting up again, if that is indeed what they're supposed to do? What might have caused them to stop in the first place? Any help would be greatly appreciated!Thanks!
Posted
by kochg.
Last updated
.