-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
docker kiwix-serve crashing #579
Comments
Sounds really similar to #573. It seems there some kind of instability, but so far pretty unclear where. |
After running docker logs on the instance with the less switch I have found that there is no error output. I get just the standard output telling me the IP and port etc. and that it is running and then immediately after that the debug output of "the content of /data is" followed by hundreds of lines of the content as described above. |
OK. so ran this for 4 hours with up to 14 users trying it, sometimes together sometimes separately and with no issues. the server stayed up and monitored the docker container, the CPU and memory usage were quite low, although higher in the stats than I would expect (docker is still fairly new to me). Everything appears stable on a small zim file. I hope this may be giving some clues as to the issue. I never managed to get kiwix-serve working outside a docker container, so cannot see how it performs there. |
@veloman-yunkan We should really try to reproduce the error with the SO specific file and get the core dump. From there it should be easier to diagnose the problem... hopefuly. |
@kelson42 I will try to reproduce the crash |
Crash was reproduced using the latest (3.3.0-1) docker image of kiwix-serve and http://download.kiwix.org/zim/stack_exchange/stackoverflow.com_en_all_2022-05.zim. Will debug it. |
CPU percentage is relative to one core. If you have 4 core, the maximum CPU usage is 400%. So a percentage above 100% is just that we use more than one core (and with multithreading, it is easy) |
thanks @mgautierfr that makes sense. |
After kiwix-serve is started, it can take as little as only two properly timed requests to the |
On my machine, with hot filesystem the following script crashes kiwix-serve with quite high probability: #!/usr/bin/env bash
./kiwix-serve --verbose -p 8080 stackoverflow.com_en_all_2022-05.zim &
sleep 1
(
curl 'http://localhost:8080/suggest?content=stackoverflow.com_en_all_2022-05&userlang=en&term=c' &
sleep 0.2; curl 'http://localhost:8080/suggest?content=stackoverflow.com_en_all_2022-05&userlang=en&term=co' &
)
wait |
Such a crash scenario should greatly facilitate debugging. |
These crashes caused by concurrent suggestion requests on the same book are most likely due to the combination of:
|
Top prio to fix obviously and no nrw release of libzim/libkiwix should be done before fixing. I would appreciate if such scenarios are intoduce in automated testa too. |
The search should be protected again race condition : https://github.com/kiwix/libkiwix/blob/master/include/library.h#L145-L158 and https://github.com/kiwix/libkiwix/blob/master/src/server/internalServer.cpp#L781 I don't know why this is not the same case for suggestion. |
Protection against race conditions in |
Yes, but I have seen the issue for search (and so implement the protection) but I totally missed the case for suggestion. |
Will the docker image be updated with this fix? |
@monstermaker Yes, once the release will be done... soon but no clear date for the moemnt. |
I have been running the stackoverflow zim file and found that the server crashes intermittently. Initially, it appeared to crash whenever you used the search with keywords "add" and "delete" in it, but then it stopped crashing on these and sometimes just crashes.
I cannot see the exit message as it appears to list the contents of the /data folder on crashing which appears as a very long list in my console window and I cannot scroll back far enough in the window to see any messages before the list of /data/.npm and /data/.cache so cannot see what may be causing it.
We are running on Ubuntu 18.04 using the latest docker image.
The text was updated successfully, but these errors were encountered: