-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Document that accessing Multiplayer from Node
is not thread-safe
#79326
Conversation
An additional option to reduce crashes in some contexts would be to add null checks in some methods on Edit: done, #79332 |
Ping @Faless |
cf04adb
to
d3da7c7
Compare
I'm torn on this. It is useful info in the edge case that you are calling them from another thread, but it also adds a lot of clutter if we add this bit in all functions that are not thread safe everywhere. The default assumption should be that things are not thread-safe unless stated otherwise, especially anything interacting with nodes or the scene/SceneTree, IMO. OTOH, if you are new, you may not expect "multiplayer.function()" to be interacting with the Node/SceneTree like it is and think it is some kind of global thing, or something. I'm undecided. :/ |
Wouldn't it make sense to add it to the It could be a warning instead of a note, as well. |
Not sure about the location (as not all who use the multiplayer use |
I feel very strongly for the warning in |
I agree with this POV. With the crashes fixed by #79332, I think the original issue should be closed and we don't need to add warnings specifically in these few methods. Instead it should be made clear in the multiplayer documentation in the manual. |
Closing as per above, will look at the manual side 🙂 |
Unsure about the exact wording so took that from the error message of
SceneTree
Only added to
Node
as the API isn't necessarily restricted but the access to it fromSceneTree
is, andSceneTree
is stated to be non-safeCloses: #79323