Fix TamableAnimal race condition #426
No reviewers
Labels
No labels
documentation
good first issue
help wanted
resolution: duplicate
resolution: invalid
resolution: won't fix
status: needs triage
type: bug
type: feature
type: performance
type: question
version: 1.19.4
version: 1.20
version: 1.20.1
version: 1.20.2
version: 1.20.4
version: 1.20.6
version: 1.21.11
version: 1.21.4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Minecraft/Folia!426
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "CraftCanvasMC/fix/tamableanimal-racecond"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With Folia, teleporting a tamed animal, like a wolf, to a player that is now not in the same region, is technically thread-safe because of Folias current patch. However, there is a race condition where if the chunk the tamed animal is trying to teleport to isn't loaded yet, it crashes the server because when it is trying to check if it CAN teleport, it tries to check blocks in that chunk, but if the chunk isn't loaded, it tries to load it. Thus causing a crash since if the target location isn't in the same region, it will kill the server because of a bad access(trying to load chunk outside owning region).
The fix proposed here just checks if the chunk is loaded first, and if it is loaded, then it will proceed. Otherwise, returns false.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.