Skip to content
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

Periodic Freezing during Menu and Multiplayer Gameplay #4697

Closed
DorpsGek opened this issue Jul 27, 2011 · 4 comments
Closed

Periodic Freezing during Menu and Multiplayer Gameplay #4697

DorpsGek opened this issue Jul 27, 2011 · 4 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

LordAro opened the ticket and wrote:

Reported by MorgyN on IRC

OS: Windows 7 x64

During the Menu and during multiplayer game play, periodically the UI, Network & Gameplay would freeze, Music would continue.

Freezes would last 2-10 seconds, and would happen every 10-60 seconds.

Appears to be linked to a name resolution error of a favourited server.

If the following entry is in openttd.cfg

[servers]
roosta.zem.org:3979 =

The above error occurs.

Reported version: 1.1.1
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/4697
@DorpsGek
Copy link
Member Author

Rubidium wrote:

I cannot reproduce the game even attempting to query a server without going the multiplayer game, so how can it happen in the main menu? This under the assumption that he spoke the truth when being asked whether he was in the multiplayer window.

If he was not telling the truth and he was in the multiplayer windows, then something fishy is going on w.r.t. name resolution which should not happen at all. As far as I can see the name resolution always happens in a separate thread, so the rest of the application should run fine which the name resolution is waiting for results.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4697#comment10113

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Fixed

In r22695


This comment was imported from FlySpray: https://bugs.openttd.org/task/4697

@DorpsGek
Copy link
Member Author

adf88 wrote:

Hi Rubidium, do you know what was causing the freeze? Why the name resolution wasn't done in a separate thread?


This comment was imported from FlySpray: https://bugs.openttd.org/task/4697#comment10132

@DorpsGek
Copy link
Member Author

Rubidium wrote:

Name resolution was, generally, done in a seperate thread. However, when name resolution failed the address would remain marked as unresolved and any other activity on said address would trigger another attempt to resolve it, which incidentally happened when trying to send some data which needs to take the mutex on the udp socket. Then the main thread would block trying to read the socket. Other cases are e.g. comparisions on addresses done when inserting it in the server list, which would trigger an unresolved address to be resolved (which would again fail).

So... the fix is easy: if resolution fails, mark it as resolved and don't try to resolve it later on. Only resolve it in the thread the next time you try to connect to it.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4697#comment10134

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant