-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updateFile - some files may get stuck in is_downloading_active
in poor network conditions
#2585
Comments
Your network connection seems to be extremely poor. The connections are closed by timeout all the time, because they can't receive request response in 10-30 seconds. |
Ah. In that case where connections are timed out, am I right to say that there will not be any new I am using the macOS's network link conditioner to simulate slow networks, which was done so, because I have personally frequently observed stalled image downloads on the watch, when I am out, which I guess is with the watch networking being always much much slower than on phone for whatever reasons, even both phone and watch are on the same cellular network or when the watch is sharing the phone's connectivity. |
It will be true until the file is successfully downloaded. There are no "stailed" downloads. The download is in progress and it should eventually succeed, but currently it can't succeed due to extemely poor network. It fails to download 20 kilobytes of data in 10 seconds. |
No, it only means that 1376 was very lucky to have no lost packets, despite each packet is lost with 10% probability. I wouldn't expect file download to work with 10% packet loss. It is almost a broken network for TCP. |
The connections are closed and reopened by TDLib, because no data has been received for 7-44 seconds through them. |
@levlam, I am very sorry for the waste of resources and the opening of this issue. I had another look into the log, namely, the last log that I've sent to the bot, and I realised, that the testing was in fact, flawed, as there was actually a messageAnimation, 4.83MB file (id 5820), downloading as well without my knowledge at the time of conducting the tests, which I assume, used basically all of the already limited bandwidth. That was, in fact, the main problem. However, before I close this issue, may I ask, to verify my latest understanding of how downloadFile's priority works? As a accidental discovery, I realised id 5820 is downloading with priority of 5, while the earlier file id of 5237 is downloading with priority of 30. Am I right to say with the above context, that, as long as a download has started, priority no longer matters? I realise 5820's downloadFile was called before 5237, so my understanding with this is 5820's download will need to finish, before 5237 starts to download. Thank you. |
Files are downloaded in a small chunks. Priority always matters for yet unsent file part request, but ongoing requests aren't canceled if a new download with higher priority is started. So, a part of the animation will be downloaded, then the photo, and then the rest of the animation. |
In the case of the final log, I observed the following: (Numbers refers to timestamp) 5237 Since 5820 continued to receive updateFile in between the time of 5237's download, can I verify with you that, the updateFile calls are in response to the requests sent before 1692783572? |
I assume this cannot be known from the log? If so I will close this issue. |
Observed on watchOS.
I will send a log to the bot, verbosity level of 10 shortly after submitting this, which the relevant ids shared below, corresponds to this log.
Using
downloadFile
, synchronous = false, priority 30, to download a file of size 23520 bytes, seems to not be downloaded at all, after waiting for about 5 minutes, withdownload_size
oflocalFile
being 0, throughout allupdateFile
calls. This problematic file's id is 1376.I believe poor network conditions that is specifically used in this testing, is partly a cause to this, but what seem odd to me, is when, after 5 minutes, I tried to download another different file, this time, of size 19364 bytes, which successfully downloaded in about a minute, with the same settings and same network conditions as above. This file's id is 1369.
Both files are from 2 different messagePhoto, type m, width 320 photo files.
The text was updated successfully, but these errors were encountered: