I have met a problem that url requests for downloading images will end with timeout error for single domain while other domain works well, when I ping with the failed domain, the result shows the domain is reachable.
Error message:
error:A URL session error happened. The underlying error: Error Domain=NSURLErrorDomain Code=-1001 "timeout" UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x2831d0750
{Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <52D0D7F2-F640-4B51-A8F0-054EDDA9CB65>.<110>, _NSURLErrorRelatedURLSessionTaskErrorKey=
count:1{
"LocalDataTask <52D0D7F2-F640-4B51-A8F0-054EDDA9CB65>.<110>",
}, NSLocalizedDescription=timeout, NSErrorFailingURLStringKey={url} NSErrorFailingURLKey={url}, _kCFStreamErrorDomainKey=4}
I have tried to parse URLSessionTaskMetrics, like:
(Task Interval) <_NSConcreteDateInterval: 0x2861f6b40> (Start Date) 2023-02-14 03:00:28 +0000 + (Duration) 15.021910 seconds = (End Date) 2023-02-14 03:00:43 +0000
(Redirect Count) 0
(Transaction Metrics) (Request) <NSMutableURLRequest: 0x28228ef20> { URL: https://{private} }
(Response) (null)
(Fetch Start) 2023-02-14 03:00:28 +0000
(Domain Lookup Start) (null)
(Domain Lookup End) (null)
(Connect Start) (null)
(Secure Connection Start) (null)
(Secure Connection End) (null)
(Connect End) (null)
(Request Start) (null)
(Request End) (null)
(Response Start) (null)
(Response End) (null)
(Protocol Name) (null)
(Proxy Connection) NO
(Reused Connection) NO
(Fetch Type) Network Load
(Request Header Bytes) 0
(Request Body Transfer Bytes) 0
(Request Body Bytes) 0
(Response Header Bytes) 0
(Response Body Transfer Bytes) 0
(Response Body Bytes) 0
(Local Address) (null)
(Local Port) (null)
(Remote Address) (null)
(Remote Port) (null)
(TLS Protocol Version) 0x0000
(TLS Cipher Suite) 0x0000
(Cellular) NO
(Expensive) NO
(Constrained) NO
(Multipath) NO
A lot of users have reported images loaded failed in my app for this reason. I'm confused with why 'Domain Lookup' do not start? And reason that requests got timeout error in which step.