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

Alternative I: Reduce active mgmt interval for a bit when a player joins #12925

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

lhofhansl
Copy link
Contributor

@lhofhansl lhofhansl commented Nov 3, 2022

Alternative to #12927
Fixes #10884

When a player joins, active blocks take a bit to be emerged and activated, which means entities stored there take some time to appear.
When the player has been attached to (say) a flying entity they will now fall to their deatch.

Is this a quick fix. A full fix would enqueue these blocks immediately and then activate them upon emerge.

Downside: The server does more work for a short time when the effective mgmt interval is shortened for everyone.

How to test

Attach yourself to a flying entity. Try the balloon, blimp or similar mods. Leave and rejoin. You should be re-attached immediately.

@lhofhansl lhofhansl added the WIP label Nov 3, 2022
@lhofhansl
Copy link
Contributor Author

lhofhansl commented Nov 4, 2022

Note, I also implemented the alternative: Pass a flag to map->getBlockOrEmerge(...) and pass that through to the emerge thread(s), and then activate the blocks as soon as it is emerged. I have not observed that to be better (but I also haven't tested that with many users.)

If folks are interested I can post that as alternate PR. NM: See #12927

@lhofhansl lhofhansl removed the WIP label Nov 4, 2022
@lhofhansl lhofhansl requested a review from sfan5 November 4, 2022 00:14
@Zughy Zughy added Bugfix 🐛 PRs that fix a bug @ Server / Client / Env. Discussion Issues meant for discussion of one or more proposals labels Nov 4, 2022
@lhofhansl lhofhansl added the WIP label Nov 4, 2022
@lhofhansl lhofhansl changed the title Discuss: Reduce active mgmt interval for a bit when a player joins. Reduce active mgmt interval for a bit when a player joins. Nov 4, 2022
@lhofhansl lhofhansl removed the Discussion Issues meant for discussion of one or more proposals label Nov 4, 2022
@lhofhansl lhofhansl changed the title Reduce active mgmt interval for a bit when a player joins. Alternative I: Reduce active mgmt interval for a bit when a player joins. Nov 6, 2022
@lhofhansl lhofhansl removed the WIP label Nov 6, 2022
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this one for its simplicity even if it's not perfect.

@sfan5 sfan5 changed the title Alternative I: Reduce active mgmt interval for a bit when a player joins. Alternative I: Reduce active mgmt interval for a bit when a player joins Nov 10, 2022
@lhofhansl
Copy link
Contributor Author

I agree that this more "organic" than the other option. It will also deal well with a slow server my trying a few time with larger wait times in between.

@lhofhansl lhofhansl merged commit 1a045da into minetest:master Nov 10, 2022
appgurueu pushed a commit to appgurueu/minetest that referenced this pull request May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entities appear again with some latency after restarting a world.
3 participants