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

not avoiding race condition #17

Open
morlanius opened this issue Aug 20, 2018 · 4 comments
Open

not avoiding race condition #17

morlanius opened this issue Aug 20, 2018 · 4 comments

Comments

@morlanius
Copy link

minetest.after(0, change_skin, player)

Change this to this to actually avoid the race condition.
minetest.after(1, change_skin, player)

@bell07
Copy link
Collaborator

bell07 commented Aug 20, 2018

Can you please describe the race condition you try to solve? Any error message?

On my current conjecture no race conditions should be possible because the skinsdb set the skin synchron and character_creator override it in next step after(0).
Do you use any other skins manipulator mods?

@morlanius
Copy link
Author

morlanius commented Aug 20, 2018

Between loading the skin and the skin being applied. This was happening on my server with no error messages as there was no error.

No other skin mods.

Symptom: Player custom skin not being displayed after login.
Cause: Race condition between skin_load and skin_change.
Solution: Add a small delay between loading_skin and change_skin

@bell07
Copy link
Collaborator

bell07 commented Aug 20, 2018

load_skin is called synchronous in Line 239. always before the change_skin.
The change_skin is called allways later, in next game step trough minetest.after().
Still do not see how race condition can happens.

After login the player is "Sam"? Is the issue reproduceable? If yes, please add some debug "print" in mentioned functions to check the call order.

PS: A delay is allways an workaround, i like to try to understand the issue and find a proper solution.
THe assumption you use the skinsdb is correct, right? Is the skinsdb mod up-to-date?

@bell07
Copy link
Collaborator

bell07 commented Aug 24, 2020

@morlanius , can you please check if the fix #18 solves this issue too? The race condition was related to the 3d_armor mod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants