Catch attribute modification off the main thread.#13639
Catch attribute modification off the main thread.#13639mbax wants to merge 1 commit intoPaperMC:mainfrom
Conversation
The clear() call in refreshDirtyAttributes can lead to server crashes if called asynchronously. This async catcher addition should highlight which plugins cause the trouble.
|
Last updated for: 6973055ee1cfe4560961e003e7caf3953cbb8ce9. Download the Paperclip jar for this pull request: paper-13639.zip Maven PublicationThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven("https://maven-prs.papermc.io/Paper/pr13639") {
name = "Maven for PR #13639" // https://github.com/PaperMC/Paper/pull/13639
mavenContent {
includeModule("io.papermc.paper", "dev-bundle")
includeModule("io.papermc.paper", "paper-api")
}
}
} |
|
I don't think this would be the correct place to add this, the root cause would be plugins interacting with AttributeInstance concurrently, resulting in setDirty being called & mutating attributesToUpdate, or (more unlikely) directly interacting with that set themselves. This method just happens to be where the server trips into it and ends up causing this untraceable error. |
|
My assumptions in writing this (I'm curious which are wrong):
|
|
Seems like my assumption was the one that was wrong, I always thought of this as being comparable to a CME, which traditionally also happens when elements are added during iteration, but doesn't seem to be the case here. |
Warriorrrr
left a comment
There was a problem hiding this comment.
A plugin you could test this with was recently found in paper-help https://discord.com/channels/289587909051416579/289587909051416579/1460254564480450601
| } | ||
|
|
||
| private void refreshDirtyAttributes() { | ||
| + org.spigotmc.AsyncCatcher.catchOp("attribute update"); // Paper |
There was a problem hiding this comment.
This could maybe be using TickThread#ensureTickThread(Entity, String)
|
A user still got the issue with this current code, so there's something missing. https://mclo.gs/YL7HZQ8 |
The
clear()call inrefreshDirtyAttributescan lead to server crashes if called asynchronously. This async catcher addition should highlight which plugins cause the trouble.Untested (due to not knowing what plugins cause the issue), but seems to be the only place that this could be getting triggered. Using this PR for
publish-prto attempt helping users, to see if it works out!