-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Kiwix goes into non responsive when trying to download 78GB wikipedia #87
Comments
@Emnolope This is a bit strange. This happens directly after starting the download? Or later? Is Kiwix Desktop then unresponsive during the whole download? |
I found I was able to get it to work, by starting the download, waiting for
the program to crash, then restarting the program without restarting the
download.
…On Sun, Dec 23, 2018 at 7:18 AM Kelson ***@***.***> wrote:
@Emnolope <https://github.com/Emnolope> This is a bit strange. This
happens directly after starging the download? Or later? Is Kiwix Desktop
then unresponsive during the whole download?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AqyAjNuIEB5DZMUpZEUY8Wu-XKUV82wwks5u757WgaJpZM4Zfqmm>
.
|
When I do this, it becomes, well at least, somewhat stable
On Mon, Dec 24, 2018 at 6:58 PM Emmanuel Lopez <[email protected]>
wrote:
… I found I was able to get it to work, by starting the download, waiting
for the program to crash, then restarting the program without restarting
the download.
On Sun, Dec 23, 2018 at 7:18 AM Kelson ***@***.***> wrote:
> @Emnolope <https://github.com/Emnolope> This is a bit strange. This
> happens directly after starging the download? Or later? Is Kiwix Desktop
> then unresponsive during the whole download?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#87 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AqyAjNuIEB5DZMUpZEUY8Wu-XKUV82wwks5u757WgaJpZM4Zfqmm>
> .
>
|
This shouldn't. The download itself is handle by a different process. And kiwix ui just update the information every second. |
@Emnolope Have you been able to reproduce the problem with the last beta? |
@Emnolope I'm pretty convinced we have fixed all of this in last betas. If the problem still happen, please reopen the ticket. |
@mgautierfr @jetownfeve21 I have to reopen this ticket as it still does not work properly with the RC1. I have downloaded the last version of WPDE (with pictures). The Kiwix UI get frozen (and the Ubuntu OS also complains about it) time to time during a long/big download. It also get frozen at the very end of the download process. |
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
I too experience absurd GUI response delays of multiple seconds up to a minute when saturating my internet connection by downloading multiple things. There is almost no CPU usage (probably some IO thing going on). Does the GUI loop interact synchronously with the download processes? |
@AllanWegan It looks like indeed that part of the process still run in the main UI loop. Unclear so far which one so far. |
I think I have found the root cause : In libkiwix's aria2.cpp, we use a lock to prevent a race condition when we could reuse the same curl context (https://github.com/kiwix/libkiwix/blob/main/src/aria2.cpp#L137-L156). While this make the aria2 wrapper threadsafe (as we can call it from different threads safely), it is not really multithread compliant (we cannot do several requests is parallel). We have to make the aria2 wrapper fully multrithread and also make the |
@mgautierfr I believe this line is blocking the
The RPC call is outside of the lock.The overall event loop looks like this:
When
That's true. I don't believe the startDownload call normally blocks, but I can remove the locking around My interpretation of aria2/aria2#1851, aria2/aria2#1842, and aria2/aria2#1396 is that file preallocation will always occur if |
On the lock in aria2.cpp, I don't know if it would make a difference in kiwix-desktop because there is only one thread trying to invoke the downloader at any given time. So while it could be an overall improvement, I am not sure if it will solve the specific problem here. Since we cannot always prevent aria2 from blocking during file preallocation, I will look into timing out the libcurl request and let you know. |
Ok. Indeed, the issue is not in the "real" preallocation, but just after when aria2 starts the different downloads, it does some preallocation to be sure that download threads write data at the right position. If I understand correctly, it does tihs preallocation not as a specific step, but when real downloads start.
I was thinking that it was the
And maybe |
Yes I agree, it seems like aria is doing the "preallocation" during the download itself, since I often see a few status updates (having downloaded a few bytes) before it hangs. Setting a timeout on RPC requests to aria should help prevent |
@adamlamar I've a PR to make libkiwix more thread safe and compliant on the downloading side. kiwix/libkiwix#886 With this PR, you will be able to call the |
@adamlamar Do you plan to finish this PR or I finish it ? |
I presume this issue still not fixed? I am on 2.3.1 version and it crashes every time I try download big files, and when it is not it simply does not download them fully (zim and aria file in the roaming folder), while in Kiwix it says it downloaded a file, if you try open unfinished file Kiwix crashes as well. |
\kiwix-desktop_windows_x64_2.3.1-2 freezes while downloading the UI reliably hangs while it is downloading, sometimes briefly, sometimes practically forever. 🔧 🔨 ⚒ 🛠 ⛏ |
On NixOS (Linux) it also freezes while downloading. If I click something, it opens after around 6 seconds. In the command line, it also throws out errors like:
|
@mgautierfr @adamlamar Adding @veloman-yunkan as he is foreseen to complete the PR... and hopefully after years and years fix this issue. |
@veloman-yunkan Thank you very much!!! |
Thanks a bunch @veloman-yunkan, I kind of lost steam on this issue. Thinking about it I wonder if using the QT Download manager would be a better approach. If we can get the URL from libzim, we can have the QT Download manager fetch the zim file asynchronously. |
@adamlamar we have to rely on aria2. We don't want to stick only to http download. |
What do you mean only http download? Looks like the QT Download manager supports HTTP, HTTPS, and FTP. Are you saying kiwix-desktop also supports other protocols like BitTorrent today using aria2? |
Yes, even if this is not used yet. It's based on the whole Metalink infrastructure. |
I see. If we want metalink, BitTorrent, and other protocol support, maybe we need to fix aria2's blocking on file allocation. Its pretty hard to work around aria2's blocking in the UI. |
Honestly this was expected. Is there a better way for Kiwix to handle downloads of such large files?
While I was doubting I did check the file size in windows explorer and indeed it is going up in size, however because of the large size, the computer is having difficulty with using the full capabilities of the network card.
Basically there should be a cleaner way for Kiwix handling such large downloads.
The text was updated successfully, but these errors were encountered: