New issue
Advanced search Search tips

Issue 852432 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Bug

Blocked on:
issue 786559
issue 856349



Sign in to add a comment

[Cronet] NSURLRequest gets timeout error if data upload time exceeds the timeoutInterval

Project Member Reported by mef@chromium.org, Jun 13 2018

Issue description

Cronet implementation if NSURLRequest is affected by timeoutInterval value set on the NSURLSession or NSURLRequest. 

According to https://developer.apple.com/documentation/foundation/nsmutableurlrequest/1414063-timeoutinterval?changes=_2 the timeout gets triggered when "request remains idle for longer than the timeout interval".

Unfortunately there are no NSURLProtocolClient (https://developer.apple.com/documentation/foundation/nsurlprotocolclient) callbacks to notify system that upload is progressing, so the request appears idle until response is received. If the upload time exceeds timeoutInterval, then request gets canceled with an error.

I've verified that this problem applies to both chunked and non-chunked uploads, so pacing of data reads does NOT resolve the issue. 

This appears to be a system API limitation with the only workaround being increased timeout interval.
 

Comment 1 by mef@chromium.org, Jun 13 2018

I've created https://chromium-review.googlesource.com/c/chromium/src/+/1099142 that reproduces the problem.
Cc: mef@chromium.org
Owner: kapishnikov@chromium.org
Status: Assigned (was: Untriaged)
Cc: -kapishnikov@chromium.org
Owner: ----
Status: Untriaged (was: Assigned)
kapishnikov is no longer working on Chrome, sadly.
Owner: mef@chromium.org
Status: Assigned (was: Untriaged)
mef: It looks like kapishnikov isn't working on Chrome anymore. Is there a more appropriate owner for this bug?
Blockedon: 786559
Owner: ----
Status: Available (was: Assigned)
I'll make it available, but we don't have any good ideas about addressing it. 

I see 2 potential options:

(1) Finish upload support in cronet native api and recommend that over NSURLRequest.

or

(2) Set NSURLRequest timeout to some very large value to avoid it being triggered and set an internal timeout in CRNHTTPProtocolHandler to manually cancel request if there is no progress.

I'm working on option (1) and have WIP CL https://chromium-review.googlesource.com/c/chromium/src/+/1086127


The option (1) is now implemented and available. 

It should provide lesser overhead than option (2) at the cost of completely new and different API.
Blockedon: 856349

Sign in to add a comment