Looks like no one’s replied in a while. To start the conversation again, simply ask a new
question. Question: Question: Request Timed Out Apple MusicApple Music seems to be having an issue with iOS 15/15.0.1. While on a cellular connection, about 80% of the songs I try to play time out. I’m getting a very strong cell connection with great throughput, so it’s not that. It seems to work normally while on Wi-Fi. I’ve tried restarting, restoring to factory, a new phone (iPhone 12 to iPhone 13), but get the same issue. I’m pretty tech savvy, but I can’t figure this out. Help! iPhone 13 Pro Max, iOS 15 Posted on Oct 3, 2021 10:32 PM User profile for user: ZJ_atc Question: Request Timed Out Apple Music Hi all, I'm facing a very strange problem in my application. In particular, using the application when a request receives a timeout message, all the following ones receive a timeout too (see screenshot).
I'm not sure if this happens when the application enters the foreground after a background state since it's quite difficult to replicate. Based on what exposed,
Waiting for a reply I thank you for your attention. Thanks, Lorenzo RepliesHi Lorenzo, At first glance this does look like a server issue. Could that be the case? But it could just as well be related to being in the background as well, yes. But looking at your screenshot your statement:
does not seem to be true. There are still a bunch of URLSessionTasks that finish successfully but were started after your first request received a timeout. E.g. from your screenshot, the task with task identifier 172 started at 04:15.141.186 and it received timeout 30.79s later, so around 04:46. But task 179 starts at 05:05.274.264 and finishes successfully, even though it starts well after the first timeout. And so does task 20. Task 179 is even on the same session as 172 and is also a GET request. Based on the duration I'm guessing that it wasn't handle by the local cache (but the instrument should give you this information as well). Are these two requests connecting to the same server as well? (your screenshot doesn't contain information about the host and path the request was sent to). To get more information about what your app's state is (foreground or background), you can add the "Time Profiler" instrument to your document in addition to the "HTTP Traffic" instrument (use the Plus-button in the top right of the toolbar). Then make sure Instrument launches your app and you are not just attaching to the process after the fact. This way, you should get an "App Lifecycle" lane on your process track, which allows you to cross-reference which tasks were started (and finished) while the app was in the background or in the foreground. I also recommend to take a closer look at the domain track for these tasks. The intervals drawn there should show you how long the underlying transactions for your tasks were blocked and whether they ever managed to send out the request or they timed out before even sending the request. Hi Joachim, I really appreciate your response. Thank you very much! Below my replies / notes:
Since you are confirming those
issues could be due to background state, I've started to implement a way to handle this using In particular, when I need to perform a request, I create both a new background task identifier and session data task like the following.
where
It's a very old legacy code so I'm not sure this is the right way to handle such a scenario.
Take a look at the documentation for the HTTP Traffic instrument, the section "View the Track Hierarchy" has a screenshot showing the different tracks. The higher-level tracks give you summary information, the domain track gives you the most details about each task, including how many HTTP Transactions were made as part of it (e.g. whether redirects happened) and details like how long a transaction was blocked before it started sending its request.
The easiest way to see this is to switch the Track Display style to "HTTP Transaction by Connection" in the domain track. The section "View Tasks and Transactions" in the docs describes how to do that. Once you selected that view, you should see lanes for each connection labeled "Connection 1", "Connection 2" and so on. If any transactions are handled by the cache instead of a connection, there will be a lane with "Local Cache". You can see an example in the WWDC session about the HTTP Traffic instrument here: https://developer.apple.com/videos/play/wwdc2021/10212?time=1455 Regarding the background handling in general: If you want your downloads or uploads to continue even when your app is in the background, you might want to look into [background sessions].(https://developer.apple.com/documentation/foundation/url_loading_system/downloading_files_in_the_background) They don't require you to start and end a background task, but make handling the response a little more complex. Whether it's worth the tradeoff depends on your use-case. Hi Joachim, thank you very much for the detailed info. I have additional questions for you:
I can answer these questions:
How do I fix request timed out on iPhone?Go to Settings > General > Transfer or Reset [Device] > Reset > Reset Network Settings. Keep in mind, this also resets Wi-Fi networks and passwords, cellular settings, and VPN and APN settings that you've used before. You can also try updating to iOS 15.3 to see if the issue persists.
What does the request timed out mean?In most cases, a "Request Timed Out" message is caused by a firewall blocking the connectivity. Before you can ping, you'll need to ensure that the target machine has a green status indicator.
Why does my Apple Music keep saying resource not available?The first thing you should do when the “Resource Unavailable” message appears is close and relaunch the Apple Music app. This will sometimes address the problem and is simple to do. If the issue remains, navigate to the settings for the next round of possible fixes.
Why does my Apple Music keep pausing at 15 seconds?In a situation like this we recommend taking the following steps to resolve it: Restart your iPhone - Apple Support. Remove and redownload your downloaded music. Delete music, movies, and TV shows from your device - Apple Support.
|