I've made some changes to the network code which hope to resolve most of
the problems with the server hanging and becoming unresponsive.
As far as I can work out, the problem went something like this:
- a user with a slow connection connects to wesnothd
- this user starts sending a large amount of data to wesnothd (perhaps
they are starting a game)
- wesnothd hangs in the 'receive_data()' function while it waits for the
user to send their data. It can't process requests from other clients
during this time.
I have attempted to resolve this problem by making receives take place
in worker threads, and not in the main thread. This way if a user takes
a long time to send data, it will just hang one worker thread on the
server, instead of the main thread and stop any processing.
However, this change is non-trivial (obviously! It involves adding
threads...), and I'd like to get it well-tested before the next release.
I was wondering of the feasibility of using a patched wesnoth-0.8.11
wesnothd at server.wesnoth.org to see how well the changes work. I
believe all you'd need is the normal 0.8.11 sources, with network.cpp,
network.hpp, network_worker.cpp, and network_worker.hpp from CVS HEAD.
Also, has anyone done much testing of the network code I added? Any
results to report?
David