Understanding Minetest scheduling

User avatar
Hume2
Member
 
Posts: 444
Joined: Tue Jun 19, 2018 08:24
Location: Czech Republic
GitHub: Hume2
In-game: Hume2

Understanding Minetest scheduling

by Hume2 » Thu Dec 12, 2019 17:41

I don't understand what is happening there. For each step, there is a fixed list of actions which need to be done. It's coded in serverenvironment.cpp. It is:
  • Increment game time
  • Handle players
  • Manage active block list
  • Mess around in active blocks
  • Step script environment (run global on_step())
  • Step active objects
  • Manage active objects
  • Manage particle spawner expiration
And then all of these run ocer and over and over.
So if the stderr says twice in a row that ABMs took too long, all the actions in between should be performed too. So it basically says that whole the cycle has been passed at least once.

...but...

It sometimes happens that player actions are delayed a lot (>10 mins) while everything else runs fluently. The stderr says once per while that ABMs took too long. So the server is performing these steps but why are the player actions ignored???
If you lack the reality, go on a trip or find a job.
 

User avatar
Krock
Developer
 
Posts: 4469
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Understanding Minetest scheduling

by Krock » Thu Dec 12, 2019 17:51

Player actions are packets sent to the server. So if those are delayed there's a packet processing issue.
Consider testing 5.2.0-dev if you're not already doing that. Recently there were some network improvements.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
Hume2
Member
 
Posts: 444
Joined: Tue Jun 19, 2018 08:24
Location: Czech Republic
GitHub: Hume2
In-game: Hume2

Re: Understanding Minetest scheduling

by Hume2 » Thu Dec 12, 2019 19:09

Thanks for reply! I didn't try 5.2.0 so far, It looks like it's worth a try.
If you lack the reality, go on a trip or find a job.
 

micheal65536
Member
 
Posts: 160
Joined: Mon May 22, 2017 20:27

Re: Understanding Minetest scheduling

by micheal65536 » Fri Dec 13, 2019 09:30

It's interesting to see this issue mentioned here, as I have also observed two similar issues neither of which make sense according to my (limited) understanding of the Minetest code.

The first is a server-side issue on a server that I play on, where the lag between doing something and seeing the result will suddenly become extremely high (around 30 seconds to a few minutes). This affects both interacting with the world (digging/placing blocks, opening/closing doors, and so on) and sending chat messages. What is very strange about it though is that the server has a mod that shows chat messages from an IRC channel in the in-game chat, and these messages still show up straight away even when the in-game chat messages are lagging heavily. Also, most of the time (not always) entities still move smoothly (items in pipeworks tubes go around corners and animals change their direction from time to time without "jumping" back to a previous position). EDIT: This appears to correspond to GitHub issue 9111: https://github.com/minetest/minetest/issues/9111

The second is a client-side issue where on some occasions the client will show progressively higher lag the longer the player has been in the game. This affects both interacting with the world and receiving chat messages. What's interesting here is that chat messages are still sent straight away and other players will see them (nominally) straight away, but the player in question won't see them until later. It's as if the client is somehow taking longer than expected to get through some event loop and then never "catching up" again while incoming events are queued up. EDIT: This might correspond to GitHub issue 8207, or otherwise it could be a client-side "parallel" of issue 9111: https://github.com/minetest/minetest/issues/8207
 

User avatar
gpcf
Member
 
Posts: 345
Joined: Fri May 27, 2016 10:48
In-game: gabriel

Re: Understanding Minetest scheduling

by gpcf » Fri Dec 13, 2019 19:47

I can say that I have tried the server-side patch and even backported it to 0.4.17. It really does do wonders, and made our laggy server come back to life.
 

User avatar
Hume2
Member
 
Posts: 444
Joined: Tue Jun 19, 2018 08:24
Location: Czech Republic
GitHub: Hume2
In-game: Hume2

Re: Understanding Minetest scheduling

by Hume2 » Mon Dec 30, 2019 19:43

Updating to 5.2.0-dev seems to solve the issue. Thanks!
If you lack the reality, go on a trip or find a job.
 


Return to Problems



Who is online

Users browsing this forum: No registered users and 4 guests